<template>
	<div class="app-container">


		<div class='srf-card' v-if="orgAccount.htAccountNo!=null">
			<div class="srf-top">
				<img class="icon" src="@/assets/rong/icon_house.png" alt="" />
				<div>{{orgAccount.orgName}}</div>
			</div>
			<div class="srf-cont">
				<div class="srf-item">
					<div class="t">宝付支付账号：{{orgAccount.htAccountNo}}</div>
					<div class="d">
						线下打款子账号 [ 户名：宝付网络科技(上海)有限公司 开户行：宝付网络-备付金账户 账号：{{orgAccount.accountNo}} ]
					</div>
				</div>
				<div class="srf-item ">
					<div class="price">
						{{orgAccount.availAmount}} 元<div><el-button link type="primary" icon="Refresh" style="font-size: 12px;" @click="getOrgInfoRefresh">刷新</el-button></div>
					</div>
				</div>
				<div class="srf-item">
					<div class="status">
						<span class="t" v-if="orgAccount.htAccountNo==null">未开户</span>
						<span class="t" v-else>已开户</span>
					</div>
				</div>
				<div class="srf-item flex-center" style="display: none;">
					<div @click="handleAdd('withdrawdata')" class="tx">提现</div>
					<div class="sz" >
						<el-dropdown>
							<span class="el-dropdown-link">
								设置
								<el-icon class="el-icon--right">
									<arrow-down />
								</el-icon>
							</span>
							<template #dropdown>
								<el-dropdown-menu>
									<el-dropdown-item>
										<div @click="handleAdd('editphone')">更换手机号</div>
									</el-dropdown-item>
									<el-dropdown-item>
										<div @click="handleAdd('editpaypwd')">修改密码</div>
									</el-dropdown-item>
									<el-dropdown-item>
										<div>注销</div>
									</el-dropdown-item>
								</el-dropdown-menu>
							</template>
						</el-dropdown>
					</div>
				</div>
			</div>
		</div>


		<el-form class="search-form" :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
			<el-form-item label="订单号" prop="orderNo">
				<el-input v-model="queryParams.orderNo" placeholder="请输入订单号" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="借款人" prop="borrowerName">
				<el-input v-model="queryParams.borrowerName" placeholder="请输入借款人" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="状态" prop="orderNo">
				<el-select v-model="queryParams.status" clearable filterable placeholder="状态">		
					<el-option
					  v-for="dict in order_status"
					  :key="dict.value"
					  :label="dict.label"
					  :value="parseInt(dict.value)"
					/>
				</el-select>
			</el-form-item>
			<!-- <el-form-item label="结清证明" prop="orderNo">
				<el-select v-model="queryParams.licensePeriod" clearable filterable placeholder="结清证明">
					<el-option v-for="(item, index) in 5" :key="index" :label="item" :value="item">
						结清证明
					</el-option>
				</el-select>
			</el-form-item> -->
			<el-form-item>
				<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
				<el-button icon="Refresh" @click="resetQuery">重置</el-button>
			</el-form-item>
		</el-form>

		<el-row :gutter="10" class="mb8">
			<el-col :span="1.5">
				<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['rong:order:add']">新增</el-button>
			</el-col>

			<!-- <el-col :span="1.5">
				<el-button type="primary" plain icon="Plus" @click="handleAdd('withdrawdata')" v-hasPermi="['system:company:add']">提现</el-button>
			</el-col> -->


			<!-- <el-col :span="1.5">
                <el-button type="primary" plain icon="Plus" @click="handleAdd('borrowdata')"
                    v-hasPermi="['system:company:add']">新增共借人</el-button>
            </el-col>

            <el-col :span="1.5">
                <el-button type="primary" plain icon="Plus" @click="handleAdd('suretydata')"
                    v-hasPermi="['system:company:add']">新增担保人</el-button>
            </el-col>


            <el-col :span="1.5">
                <el-button type="primary" plain icon="Plus" @click="handleAdd('collateraldata')"
                    v-hasPermi="['system:company:add']">新增抵押物</el-button>
            </el-col> -->

			<el-col :span="1.5">
				<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['system:company:export']">导出</el-button>
			</el-col>
			<right-toolbar :showSearch="showSearch" @queryTable="getList"></right-toolbar>
		</el-row>

		<el-table v-loading="loading" :data="orderArray" @selection-change="handleSelectionChange" :row-style="{height: '46px'}">
			<el-table-column label="订单号" width="160" align="center" prop="orderNo" fixed/>
			<el-table-column label="借款人" width="120" align="center" prop="borrowerName" :show-overflow-tooltip="true" fixed/>
			<el-table-column label="借款金额" width="120" align="center" prop="borrowAmount" fixed>
				<template #default="scope">
					{{scope.row.borrowAmount}}&nbsp;元
					</template>
				</el-table-column>
			<el-table-column label="待放款金额"  width="120" align="center" prop="payTotalAmount" fixed>
				<template #default="scope">
				{{scope.row.borrowAmount-scope.row.applyTransferAmount}}&nbsp;元
				</template>
			</el-table-column>
			<el-table-column label="收款人"  width="120" align="center" :show-overflow-tooltip="true" prop="cardAccount" fixed/>
			<el-table-column label="状态"  width="100" align="center" prop="status" fixed>
				<template #default="scope">
					 <dict-tag :options="order_status" :value="scope.row.status"/>       
				</template>
			</el-table-column>
			<el-table-column label="借款天数" width="100" align="center" :show-overflow-tooltip="true" prop="borrowDays" />

			<el-table-column label="区域" width="200" align="center" :show-overflow-tooltip="true">
				<template #default="scope">
					{{scope.row.signProvince+"-"+scope.row.signCity}}
					</template>
			</el-table-column>
			<el-table-column label="受让方" width="200" align="center" :show-overflow-tooltip="true" prop="companyName" />
			<el-table-column label="小贷机构" width="200" align="center" :show-overflow-tooltip="true" prop="orgName" />
			<el-table-column label="产品名称" width="80" align="center" prop="productName" />
			<el-table-column label="申请日期" width="100"  align="center" prop="createDate">
				<template #default="scope">
				   <span>{{ happenTimeFun(scope.row.createDate, 'yyyy-MM-dd', 0) }}</span>
				</template>
			</el-table-column>
			<el-table-column label="签署方式" width="100"  align="center" prop="contractType" >
				<template #default="scope">
				  <span v-if="scope.row.contractType==1">线上</span>
				  <span v-if="scope.row.contractType==2">线下</span>
				</template>
			</el-table-column>
			<!-- <el-table-column label="进件员" width="100"  align="center" prop="orgName" /> -->

			<el-table-column label="操作" width="350" align="center" class-name="small-padding fixed-width"  fixed="right">
				<template #default="scope">
					
					<el-popconfirm width="220"  v-if="scope.row.status<3" @confirm="handleStatus(scope.row,3)"  v-hasPermi="['rong:order:edit']" confirm-button-text="确定" cancel-button-text="取消" :icon="InfoFilled" icon-color="#626AEF" title="您是否确定提交审核？">
						<template #reference>
							<el-button link type="primary">提交审核</el-button>
						</template>
					</el-popconfirm>
					<el-popconfirm width="220"  v-if="scope.row.status<3" @confirm="handleStatus(scope.row,9)"  v-hasPermi="['rong:order:cancel']" confirm-button-text="确定" cancel-button-text="取消" :icon="InfoFilled" icon-color="#626AEF" title="您是否确定取消订单？">
						<template #reference>
							<el-button link type="primary">取消订单</el-button>
						</template>
					</el-popconfirm>
					<el-popconfirm width="220"  v-if="scope.row.status==3" @confirm="handleStatus(scope.row,4)"  v-hasPermi="['rong:order:check']" confirm-button-text="确定" cancel-button-text="取消" :icon="InfoFilled" icon-color="#626AEF" title="您是否确定风控通过？">
						<template #reference>
							<el-button link type="primary">风控通过</el-button>
						</template>
					</el-popconfirm>
					<el-button link type="primary" v-if="scope.row.status==3" @click="handleBack(scope.row)" v-hasPermi="['rong:order:check']">风控驳回</el-button>
					<!-- <el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['rong:order:edit']">查看债转通知</el-button> -->
					<el-button link type="primary" @click="handleUpdate(scope.row,'order')" v-hasPermi="['rong:order:query']">详情</el-button>
				</template>
			</el-table-column>
		</el-table>

		<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />

		<!-- 弹出层 -->
		<el-dialog :title="title" v-model="open" width="1400px" append-to-body>
			<div v-if="open" class="dialog-page">

				<div class="dialog-navlist">
					<div class="nav-lsit">

						<div @click="selectNavigation(index)" class="nav-item" v-for="(item, index) in leftNavigationItems" :key="index" :class="{ 'on': index === activeNavigation }">
							{{item}}
						</div>

					</div>

				</div>

				<div class="dialog-custom">

					<!-- 申请批次 -->
					<el-form class="dialog-main" @scroll="handleScroll" ref="rightColumn" :inline="true" :model="form" :rules="rules" label-width="140px">
						<!-- 申请信息 -->
						<div ref="rightColumnItem" class="dialog-item right-column">
							<div class="dialog-tbox">
								<span>受让方信息</span><div style="padding-left: 20px;color: orangered;font-size: 14px;" v-if="form.orderFromDTO.channelRate>0">通道费率：{{form.orderFromDTO.channelRate*100}}%</div>
							</div>
							<div class="dialog-cont">

								<el-form-item label="受让方" prop="orderFromDTO.tenantId">
									<el-select class="search-vitem" v-model="form.orderFromDTO.tenantId" clearable filterable placeholder="受让方">
										<el-option
										   v-for="item in orgList"
										   :key="item.tenantId"
										   :label="item.companyName"
										   :value="item.tenantId"
										/>
									</el-select>
								</el-form-item>

								<el-form-item label="小贷机构" prop="orderFromDTO.orgId">
									<el-select class="search-vitem" v-model="form.orderFromDTO.orgId" @change="handleOrgChange" clearable filterable placeholder="小贷机构">
										<el-option
										   v-for="item in orgList"
										   :key="item.orgId"
										   :label="item.orgName"
										   :value="item.orgId"
										/>
									</el-select>
								</el-form-item>

								<el-form-item label="支付渠道" prop="orderFromDTO.channelType">
									<el-select class="search-vitem" v-model="form.orderFromDTO.channelType" placeholder="支付渠道">
										<el-option label="宝付支付" :value="1"></el-option>
									</el-select>
								</el-form-item>

								<el-form-item label="产品类型" prop="orderFromDTO.productType">
									<el-select class="search-vitem" v-model="form.orderFromDTO.productType" placeholder="产品类型">
										<el-option
										  v-for="dict in productList"
										  :key="dict.productId"
										  :label="dict.productName"
										  :value="dict.productId"
										/>
										
									</el-select>
								</el-form-item>


							</div>
						</div>


						<!-- 主借人信息 -->
						<div ref="rightColumnItem" class="dialog-item right-column">
							<div class="dialog-tbox">
								<span>主借人信息</span>
							</div>
							<div class="dialog-cont">

								<div class="show-tt">
									基础信息
								</div>

								<el-form-item label="签署方式" prop="orderFromDTO.contractType">
									<el-radio-group @change="($event) => { radioChange($event, 3) }" v-model="form.orderFromDTO.contractTypeText">
										<el-radio-button label="在线" />
										<el-radio-button label="线下" />
										
									</el-radio-group>
								</el-form-item>

								<el-form-item label="借款人类型" prop="orderFromDTO.borrowerType">
									<el-radio-group @change="($event) => { radioChange($event, 4) }" v-model="form.orderFromDTO.borrowerTypeText">
										<el-radio-button label="个人" />
										<el-radio-button label="企业" />
										
									</el-radio-group>
								</el-form-item>

								<el-form-item label="借款合同编号" prop="orderFromDTO.contractNo">
										<el-input class="search-vitem" v-model="form.orderFromDTO.contractNo" placeholder="借款合同编号" clearable />
									</el-form-item>
								<template v-if="form.orderFromDTO.borrowerType == 1">

									<el-form-item class="v50" label="证件类型" prop="personal.idcType">
										<el-select class="search-vitem" v-model="form.personal.idcType" clearable filterable placeholder="证件类型">
											<el-option
											  v-for="dict in idc_type"
											  :key="dict.value"
											  :label="dict.label"
											  :value="parseInt(dict.value)"
											/>
										</el-select>
									</el-form-item>

									<el-form-item :label="'证件正面\n(图片不超过5M\n,jpg,png格式)'" prop="personal.idcFront" v-if="form.personal.idcType == 1">
										<el-upload class="upload-demo avatar-uploader" accept="image/jpg,image/jpeg,image/png" action="#" :show-file-list="false" :http-request="($event) => { httpRequestPlus($event, 1,1) }">
											<el-avatar v-if="form.personal.idcFront" :src="checkUrl(form.personal.idcFront)" shape="square" :size="178" fit="contain" />
											<el-icon v-else class="avatar-uploader-icon">
												<Plus />
											</el-icon>
										</el-upload>
									</el-form-item>
									<el-form-item :label="'证件正面\n(图片不超过5M\n,jpg,png格式)'" class="v100"  prop="personal.idcFront" v-if="form.personal.idcType != 1">
										<el-upload class="upload-demo avatar-uploader" accept="image/jpg,image/jpeg,image/png" action="#" :show-file-list="false" :http-request="($event) => { httpRequest($event, 1) }">
											<el-avatar v-if="form.personal.idcFront" :src="checkUrl(form.personal.idcFront)" shape="square" :size="178" fit="contain" />
											<el-icon v-else class="avatar-uploader-icon">
												<Plus />
											</el-icon>
										</el-upload>
									</el-form-item>

									<el-form-item :label="'证件反面\n(图片不超过5M\n,jpg,png格式)'" prop="personal.idcBack" v-if="form.personal.idcType == 1">
										<el-upload class="upload-demo avatar-uploader" accept="image/jpg,image/jpeg,image/png" action="#" :show-file-list="false" :http-request="($event) => { httpRequestPlus($event, 2,1) }">

											<el-avatar v-if="form.personal.idcBack" :src="checkUrl(form.personal.idcBack)" shape="square" :size="178" fit="contain" />
											<el-icon v-else class="avatar-uploader-icon">
												<Plus />
											</el-icon>
										</el-upload>
									</el-form-item>

									<el-form-item label="主借人" prop="personal.name">
										<el-input class="search-vitem" v-model="form.personal.name" placeholder="主借人" clearable />
									</el-form-item>



									<el-form-item label="证件号码" prop="personal.idc">
										<el-input class="search-vitem" v-model="form.personal.idc" placeholder="证件号码" clearable />
									</el-form-item>

									<el-form-item label="出生年月" prop="personal.brithDate">
										<el-date-picker v-model="form.personal.brithDate" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD" placeholder="出生年月" />
									</el-form-item>

									<el-form-item label="证件生效日期" prop="personal.idcDate">
										<el-date-picker v-model="form.personal.idcDate" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD" placeholder="证件生效日期" />
									</el-form-item>



									<el-form-item label="证件有效期" prop="idcExpiry">
										<el-date-picker v-model="form.personal.idcExpiry" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD" placeholder="如果为长期有效，则不填写" />
									</el-form-item>
									<el-form-item label="身份证地址" prop="personal.idcAddress">
										<el-input class="search-vitem" v-model="form.personal.idcAddress" placeholder="身份证地址" clearable />
									</el-form-item>
									<el-form-item class="v100" label="所在地区" prop="personal.citycode">
										<el-cascader class="search-vitem" @change="($event) => { cityChange($event, 1) }" v-model="form.personal.citycode" :options="cityOpt" :props="CascaderProps" />
										<el-input class="search-vitem v60" v-model="form.personal.detail" placeholder="街道小区楼栋" clearable />
									</el-form-item>
									<el-form-item label="手机号码" prop="personal.phone">
										<el-input class="search-vitem" v-model="form.personal.phone" placeholder="手机号码" clearable />
									</el-form-item>
									<el-form-item label="最高学历" prop="personal.education">
										<el-select class="search-vitem" v-model="form.personal.education" clearable filterable placeholder="最高学历">
											<el-option
											  v-for="dict in education"
											  :key="dict.value"
											  :label="dict.label"
											  :value="parseInt(dict.value)"
											/>
									</el-select>
									</el-form-item>
									<el-form-item label="民族" prop="personal.nation">
										<el-input class="search-vitem" v-model="form.personal.nation" placeholder="民族" clearable />
									</el-form-item>
									<el-form-item label="婚姻状况" prop="personal.marriageStatus">
										<el-select class="search-vitem" v-model="form.personal.marriageStatus" clearable filterable placeholder="婚姻状况">
											<el-option
											  v-for="dict in marriage_status"
											  :key="dict.value"
											  :label="dict.label"
											  :value="parseInt(dict.value)"
											/>
										</el-select>
									</el-form-item>
									<el-form-item label="性别" prop="personal.sex">
										<el-select class="search-vitem" v-model="form.personal.sex"  placeholder="性别">
											<el-option
											  v-for="dict in sys_user_sex"
											  :key="dict.value"
											  :label="dict.label"
											  :value="parseInt(dict.value)"
											/>
										</el-select>
									</el-form-item>

									<div class="show-tt">
										工作信息
									</div>



									<el-form-item label="工作单位" prop="personal.company">
										<el-input class="search-vitem" v-model="form.personal.company" placeholder="工作单位" clearable />
									</el-form-item>

									<el-form-item label="职务" prop="personal.post">
										<el-select class="search-vitem" v-model="form.personal.post"  placeholder="职务">
											<el-option
											  v-for="dict in job_type"
											  :key="dict.value"
											  :label="dict.label"
											  :value="dict.value"
											/>
										</el-select>
									</el-form-item>

									<el-form-item label="职称" prop="personal.postTitle">
										<el-select class="search-vitem" v-model="form.personal.postTitle"  placeholder="职称">
											<el-option
											  v-for="dict in post_name"
											  :key="dict.value"
											  :label="dict.label"
											  :value="dict.value"
											/>
										</el-select>
									</el-form-item>

									<el-form-item label="单位所属行业" prop="personal.companyType">
										<el-select class="search-vitem" v-model="form.personal.companyType"  placeholder="单位所属行业">
											<el-option
											  v-for="dict in businesses_type"
											  :key="dict.value"
											  :label="dict.label"
											  :value="parseInt(dict.value)"
											/>
										</el-select>
									</el-form-item>

									<el-form-item label="单位联系电话" prop="personal.companyTel">
										<el-input class="search-vitem" v-model="form.personal.companyTel" placeholder="单位联系电话" clearable />
									</el-form-item>


								</template>

								<template v-if="form.orderFromDTO.borrowerType == 2">
									<el-form-item class="v100" :label="'营业执照\n(图片不超过5M\n,jpg,png格式)'" prop="company.license">
										<el-upload class="upload-demo avatar-uploader" action="#" :show-file-list="false" :http-request="($event) => { httpRequestPlus($event, 3,2) }">
											<el-avatar v-if="form.company.license" :src="checkUrl(form.company.license)" shape="square" :size="178" fit="contain" />
											<el-icon v-else class="avatar-uploader-icon">
												<Plus />
											</el-icon>
										</el-upload>
									</el-form-item>
									<el-form-item label="公司名称" prop="company.companyName">
										<el-input class="search-vitem" v-model="form.company.companyName" placeholder="公司名称" clearable />
									</el-form-item>



									<el-form-item label="统一信用代码" prop="company.creditCode">
										<el-input class="search-vitem" v-model="form.company.creditCode" placeholder="统一信用代码" clearable />
									</el-form-item>
									<el-form-item label="证件生效日期" prop="company.companyDate">
										<el-date-picker v-model="form.company.companyDate" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD" placeholder="证件生效日期" />
									</el-form-item>
									<el-form-item label="证件有效期" prop="company.licenseExpiry">
										<el-date-picker v-model="form.company.licenseExpiry" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD" placeholder="如果为长期有效，则不填写" />
									</el-form-item>
									<el-form-item class="v100" label="注册地省市区" prop="company.citycode">
										<el-cascader class="search-vitem" @change="($event) => { cityChange($event, 2) }" v-model="form.company.citycode" :options="cityOpt" :props="CascaderProps" />
										<el-input class="search-vitem v60" v-model="form.company.detail" placeholder="公司详细地址" clearable />
									</el-form-item>
									<el-form-item label="单位联系电话" prop="company.companyTel">
										<el-input class="search-vitem" v-model="form.company.companyTel" placeholder="单位联系电话" clearable />
									</el-form-item>
									<el-form-item label="单位所属行业" prop="company.companyType">
										<el-select class="search-vitem" v-model="form.company.companyType" clearable filterable placeholder="单位所属行业">
											<el-option
											  v-for="dict in businesses_type"
											  :key="dict.value"
											  :label="dict.label"
											  :value="parseInt(dict.value)"
											/>
										</el-select>
									</el-form-item>
									<el-form-item label="注册资本(万元" prop="company.companyCapital">
										<el-input class="search-vitem" v-model="form.company.companyCapital" placeholder="注册资本(万元" clearable />
									</el-form-item>
									<el-form-item label="经营范围" prop="company.companyBusiness">
										<el-input class="search-vitem" v-model="form.company.companyBusiness" placeholder="经营范围" clearable />
									</el-form-item>
									<el-form-item label="经办人手机号" prop="company.phone">
										<el-input class="search-vitem" v-model="form.company.phone" placeholder="经办人手机号" clearable />
									</el-form-item>



									<div class="show-tt">
										法人信息
									</div>


									<el-form-item class="v100" label="法人证件类型" prop="company.idcType">
										<el-select class="search-vitem" v-model="form.company.idcType" clearable filterable placeholder="法人证件类型">
											<el-option
											  v-for="dict in idc_type"
											  :key="dict.value"
											  :label="dict.label"
											  :value="parseInt(dict.value)"
											/>
										</el-select>
									</el-form-item>

									<el-form-item :label="'证件正面\n(图片不超过5M\n,jpg,png格式)'" prop="company.idcFront"  v-if="form.company.idcType == 1">
										<el-upload class="upload-demo avatar-uploader" accept="image/jpg,image/jpeg,image/png" action="#" :show-file-list="false" :http-request="($event) => { httpRequestPlus($event, 1,4) }">
											<el-avatar v-if="form.company.idcFront" :src="checkUrl(form.company.idcFront)" shape="square" :size="178" fit="contain" />
											<el-icon v-else class="avatar-uploader-icon">
												<Plus />
											</el-icon>
										</el-upload>
									</el-form-item>
									<el-form-item :label="'证件正面\n(图片不超过5M\n,jpg,png格式)'" prop="company.idcFront" class="v100" v-if="form.company.idcType != 1">
										<el-upload class="upload-demo avatar-uploader" accept="image/jpg,image/jpeg,image/png" action="#" :show-file-list="false" :http-request="($event) => { httpRequest($event, 6) }">
											<el-avatar v-if="form.company.idcFront" :src="checkUrl(form.company.idcFront)" shape="square" :size="178" fit="contain" />
											<el-icon v-else class="avatar-uploader-icon">
												<Plus />
											</el-icon>
										</el-upload>
									</el-form-item>

									<el-form-item :label="'证件反面\n(图片不超过5M\n,jpg,png格式)'" prop="company.idcBack"  v-if="form.company.idcType == 1">
										<el-upload class="upload-demo avatar-uploader" accept="image/jpg,image/jpeg,image/png" action="#" :show-file-list="false" :http-request="($event) => { httpRequestPlus($event, 2,4) }">

											<el-avatar v-if="form.company.idcBack" :src="checkUrl(form.company.idcBack)" shape="square" :size="178" fit="contain" />
											<el-icon v-else class="avatar-uploader-icon">
												<Plus />
											</el-icon>
										</el-upload>
									</el-form-item>


									<el-form-item label="法人姓名" prop="company.legalName">
										<el-input class="search-vitem" v-model="form.company.legalName" placeholder="法人姓名" clearable />
									</el-form-item>



									<el-form-item label="法人证件号" prop="company.idc">
										<el-input class="search-vitem" v-model="form.company.idc" placeholder="法人证件号" clearable />
									</el-form-item>

									<el-form-item label="法人联系方式" prop="company.legalPhone">
										<el-input class="search-vitem" v-model="form.company.legalPhone" placeholder="法人联系方式" clearable />
									</el-form-item>

									<el-form-item label="法人身份证地址" prop="company.idcAddress">
										<el-input class="search-vitem" v-model="form.company.idcAddress" placeholder="法人身份证地址" clearable />
									</el-form-item>
								</template>





							</div>
						</div>

						<!-- 申请信息 -->
						<div ref="rightColumnItem" class="dialog-item right-column">
							<div class="dialog-tbox">
								<span>借款信息</span>
							</div>
							<div class="dialog-cont">

								<el-form-item label="借款金额(元)" prop="borrowInfoFromDTO.borrowAmount">
									<el-input-number class="search-vitem" min="1" max="5000000" v-model="form.borrowInfoFromDTO.borrowAmount" controls-position="right" />
								</el-form-item>

								<el-form-item label="借款用途" prop="borrowInfoFromDTO.borrowType">
									<el-select class="search-vitem" v-model="form.borrowInfoFromDTO.borrowType" clearable filterable placeholder="借款用途">
										<el-option
										  v-for="dict in borrow_use_type"
										  :key="dict.value"
										  :label="dict.label"
										  :value="parseInt(dict.value)"
										/>
									</el-select>
								</el-form-item>

								<el-form-item label="借款天数" prop="borrowInfoFromDTO.borrowDays">
									<el-input-number @change="advanceRateChange" class="search-vitem" min="1" v-model="form.borrowInfoFromDTO.borrowDays" controls-position="right" />
								</el-form-item>

								<el-form-item label="借款起始日期" prop="borrowInfoFromDTO.beginDate">
									<el-date-picker format="YYYY-MM-DD" value-format="YYYY-MM-DD" class="search-vitem" @change="advanceRateChange" v-model="form.borrowInfoFromDTO.beginDate" type="date" placeholder="借款起始日期" />
									<el-date-picker format="YYYY-MM-DD" value-format="YYYY-MM-DD" class="search-vitem" disabled readonly v-model="form.borrowInfoFromDTO.endDate" type="date" placeholder="借款结束日期,自动生成" />
								</el-form-item>

								<el-form-item label="还款方式" prop="borrowInfoFromDTO.repaymentType">
									<el-select class="search-vitem" v-model="form.borrowInfoFromDTO.repaymentType" clearable filterable placeholder="还款方式">
										<el-option
										  v-for="dict in payment_type"
										  :key="dict.value"
										  :label="dict.label"
										  :value="parseInt(dict.value)"
										/>
										
									</el-select>
								</el-form-item>

								<el-form-item label="借款年利率(%)" prop="borrowInfoFromDTO.borrowRate">
									<el-input-number class="search-vitem" min="0" max="100" v-model="form.borrowInfoFromDTO.borrowRate" controls-position="right" />
								</el-form-item>



								<el-form-item label="解决争议方式" prop="borrowInfoFromDTO.resolutionType">
									<el-select class="search-vitem" v-model="form.borrowInfoFromDTO.resolutionType" clearable filterable placeholder="解决争议方式">
										<el-option label="诉讼解决" :value="'1'"></el-option>
									</el-select>
								</el-form-item>

								<el-form-item label="签约地" prop="borrowInfoFromDTO.citycode">
									<!-- <el-cascader class="search-vitem"  @change="($event) => { cityChange($event, 6) }" v-model="form.borrowInfoFromDTO.citycode" :options="cityOpt" :props="CascaderProps" /> -->
									<el-cascader class="search-vitem" @change="($event) => { cityChange($event, 6) }" v-model="form.borrowInfoFromDTO.citycode" :options="cityOpt" :props="CascaderProps" />
								</el-form-item>

								<el-form-item label="提前还款违约金比例" prop="borrowInfoFromDTO.advanceRate">
									<el-input-number class="search-vitem" min="0" max="100" v-model="form.borrowInfoFromDTO.advanceRate" controls-position="right" />
								</el-form-item>

								<el-form-item label="" prop="licensePeriod">
									<div style="padding-left:140px;">
										<el-button @click="getRepaymentList">预约还款计划</el-button>
									</div>
								</el-form-item>



							</div>
						</div>

						<!-- 共借人信息 -->
						<div ref="rightColumnItem" class="dialog-item right-column">
							<div class="dialog-tbox">
								<span>共借人信息</span>
							</div>
							<div class="dialog-cont">

								<el-table :data="form.orderGJList" border style="width: 100%">
									<el-table-column label="序号">
										<template #default="scope">
											{{ scope.$index + 1}}
										</template>
									</el-table-column>
									<el-table-column prop="name" label="共借主体">
									</el-table-column>
									<el-table-column prop="idc" label="身份证号/信用代码">
									</el-table-column>
									<el-table-column prop="address" label="操作">
										<template #default="scope">
											
											<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row,'borrowdata')" v-hasPermi="['rong:order:add']">查看</el-button>
											<el-popconfirm width="220" v-if="form.orderFromDTO.status == 0 || form.orderFromDTO.status == 2" @confirm="handDel(scope.row, 'borrowdata')" v-hasPermi="['rong:order:add']" confirm-button-text="确定" cancel-button-text="取消" :icon="InfoFilled" icon-color="#626AEF" title="您是否确定删除？">
												<template #reference>
													<el-button link type="primary" icon="Delete">删 除</el-button>
												</template>
											</el-popconfirm>
										</template>
									</el-table-column>
								</el-table>

								<el-button v-if="form.orderFromDTO.status == 0 || form.orderFromDTO.status == 2" @click="handleAdd('borrowdata')" class="showbtn">
									<el-icon>
										<Plus />
									</el-icon>
									<span>新增共借人</span>
								</el-button>

							</div>
						</div>


						<!-- 担保人信息 -->
						<div ref="rightColumnItem" class="dialog-item right-column">
							<div class="dialog-tbox">
								<span>担保人信息</span>
							</div>
							<div class="dialog-cont">

								<!-- <el-form-item class="search-fitem" label="保证合同签署方式" prop="establishmentDate">
									<el-checkbox-group v-model="checkboxGroup2">
										<el-checkbox-button v-for="city in 3" :key="city" :label="city">
											在线签署
										</el-checkbox-button>
									</el-checkbox-group>
								</el-form-item> -->

								<el-table :data="form.orderDBList" border style="width: 100%">
									<el-table-column label="序号">
										<template #default="scope">
											{{ scope.$index + 1}}
										</template>
									</el-table-column>
									<el-table-column prop="name" label="担保主体">
									</el-table-column>
									<el-table-column prop="idc" label="身份证号/信用代码">
									</el-table-column>
									<el-table-column prop="address" label="操作">
										<template #default="scope">
											<!-- <a :href="scope.num" type="primary" icon="Edit">查看</a> -->
											<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row,'suretydata')" v-hasPermi="['rong:order:add']">查看</el-button>
											<el-popconfirm v-if="form.orderFromDTO.status == 0 || form.orderFromDTO.status == 2" width="220" @confirm="handDel(scope.row, 'suretydata')"  v-hasPermi="['rong:order:add']" confirm-button-text="确定" cancel-button-text="取消" :icon="InfoFilled" icon-color="#626AEF" title="您是否确定删除？">
												<template #reference>
													<el-button link type="primary" icon="Delete">删 除</el-button>
												</template>
											</el-popconfirm>
										</template>
									</el-table-column>
								</el-table>

								<el-button v-if="form.orderFromDTO.status == 0 || form.orderFromDTO.status == 2" @click="handleAdd('suretydata')" class="showbtn">
									<el-icon>
										<Plus />
									</el-icon>
									<span>新增担保人</span>
								</el-button>

							</div>
						</div>


						<!-- 抵押物信息 -->
						<div ref="rightColumnItem" class="dialog-item right-column">
							<div class="dialog-tbox">
								<span>抵押物信息</span>
							</div>
							<div class="dialog-cont">

							<!-- 	<el-form-item class="search-fitem" label="生成线上抵押合同" prop="establishmentDate">
									<el-checkbox-group v-model="checkboxGroup2">
										<el-checkbox-button v-for="city in 3" :key="city" :label="city">
											在线签署
										</el-checkbox-button>
									</el-checkbox-group>
									<div class="w-tip">确认生成,合同产权人需在线签署《抵押合同》，选否则不生成合同</div>

								</el-form-item> -->

								<el-table :data="form.houseList" border style="width: 100%">
									<el-table-column label="序号">
										<template #default="scope">
											{{ scope.$index + 1}}
										</template>
									</el-table-column>
									<el-table-column prop="relationNames" label="所有权人">
									</el-table-column>
									<el-table-column prop="certificateCode" label="权属证书编号">
									</el-table-column>
									<el-table-column prop="houseAddress" label="所在地址">
									</el-table-column>
									<el-table-column prop="address" label="操作">
										<template #default="scope">
											<!-- <a :href="scope.num" type="primary" icon="Edit">查看</a> -->
											<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row,'housedata')" v-hasPermi="['rong:order:add']">查看</el-button>
											<el-popconfirm v-if="form.orderFromDTO.status == 0 || form.orderFromDTO.status == 2" width="220" @confirm="handDel(scope.row, 'housedata')" confirm-button-text="确定" cancel-button-text="取消" :icon="InfoFilled" icon-color="#626AEF" title="您是否确定删除？">
												<template #reference>
													<el-button link type="primary" icon="Delete">删 除</el-button>
												</template>
											</el-popconfirm>
										</template>
									</el-table-column>
								</el-table>

								<el-button v-if="form.orderFromDTO.status == 0 || form.orderFromDTO.status == 2" @click="handleAdd('housedata')" class="showbtn">
									<el-icon>
										<Plus />
									</el-icon>
									<span>新增抵押物信息</span>
								</el-button>

							</div>
						</div>


						<!-- 收款卡信息 -->
						<div ref="rightColumnItem" class="dialog-item right-column">
							<div class="dialog-tbox">
								<span>收款卡信息</span>
							</div>
							<div class="dialog-cont">
								<el-table :data="form.cardFromDTOList" border style="width: 100%">
									<el-table-column prop="cardAccount" label="持卡人">
									</el-table-column>
									<el-table-column prop="cardNo" label="卡号">
									</el-table-column>
									<el-table-column prop="bankName" label="所属银行">
									</el-table-column>
									<el-table-column prop="phone" label="预留手机号">
									</el-table-column>
									<el-table-column prop="address" label="操作">
										<template #default="scope">
											<el-popconfirm v-if="form.orderFromDTO.status == 0 || form.orderFromDTO.status == 2" width="220" @confirm="handDel(scope.row, 'bank')" confirm-button-text="确定" cancel-button-text="取消" :icon="InfoFilled" icon-color="#626AEF" title="您是否确定删除？">
												<template #reference>
													<el-button link type="primary" icon="Delete">删 除</el-button>
												</template>
											</el-popconfirm>
											<el-button link type="primary" v-if="form.orderFromDTO.status==4  || form.orderFromDTO.status == 5" @click="handleTransfer(scope.row)" v-hasPermi="['rong:order:edit']">放款</el-button>
										</template>
										
									</el-table-column>
								</el-table>

								<el-button @click="handleAdd('bank')" class="showbtn" v-if="form.cardFromDTOList.length==0 && (form.orderFromDTO.status == 0 || form.orderFromDTO.status == 2)">
									<el-icon>
										<Plus />
									</el-icon>
									<span>新增收款卡</span>
								</el-button>

							</div>
						</div>
						
						<!-- 放款信息 -->
						<div ref="rightColumnItem" class="dialog-item right-column">
							<div class="dialog-tbox">
								<span>放款信息</span>
							</div>
							<div class="dialog-cont">
								<el-table :data="form.transferList" border style="width: 100%">
									<el-table-column prop="transferAmount" label="放款金额(元)">
									</el-table-column>
									<el-table-column prop="cardNo" label="收款卡号">
										<template #default="scope">
											{{scope.row.cardName+" "+scope.row.cardNo}}
										</template>
									</el-table-column>
									<el-table-column prop="transferStatus" label="状态">
										<template #default="scope">
											 <dict-tag :options="transfer_status" :value="scope.row.transferStatus"/>       
										</template>
									</el-table-column>
									<el-table-column prop="phone" label="失败原因">
									</el-table-column>
									<el-table-column label="操作">
										<template #default="scope">
											<a v-if="scope.row.transferFile!=null" v-bind:href="'https://' + scope.row.transferFile" class="link-type">
											   <span>凭证</span>
											</a>
										</template>
										
									</el-table-column>
								</el-table>

							</div>
						</div>



						<!-- 附件上传 -->
						<div ref="rightColumnItem" class="dialog-item right-column">
							<div class="dialog-tbox">
								<span>附件上传</span>
							</div>
							<div class="dialog-cont">

									<el-form-item class="vvv1" label="借款合同：" prop="orderFile.borrowFile" label-width="100px">
										<file-upload class="upload-demo" :isShowTip="false" v-model="form.orderFile.borrowFile"/>
									</el-form-item>
									<el-form-item class="vvv1" label="抵押合同：" prop="orderFile.dyFile" label-width="100px">
										<file-upload class="upload-demo" :isShowTip="false" v-model="form.orderFile.dyFile"/>
									</el-form-item>
									<el-form-item class="vvv1" label="债转通知书：" prop="orderFile.zzFile" label-width="100px">
										<file-upload class="upload-demo" :isShowTip="false" v-model="form.orderFile.zzFile"/>
									</el-form-item>
									<el-form-item class="vvv1" label="保证合同：" prop="orderFile.bzFile" label-width="100px">
										<file-upload class="upload-demo" :isShowTip="false" v-model="form.orderFile.bzFile"/>
									</el-form-item>
									<el-form-item class="vvv1" label="征信报告：" prop="orderFile.zxFile" label-width="100px">
										<file-upload class="upload-demo" :isShowTip="false" v-model="form.orderFile.zxFile"/>
									</el-form-item>
									<el-form-item class="vvv1" label="房屋产权证：" prop="orderFile.houseFile" label-width="100px">
										<file-upload class="upload-demo" :isShowTip="false" v-model="form.orderFile.houseFile"/>
									</el-form-item>
									<el-form-item class="vvv1" label="补充文件：" prop="orderFile.otherFile" label-width="100px">
										<file-upload class="upload-demo" :isShowTip="false" v-model="form.orderFile.otherFile"/>
									</el-form-item>

									<!-- <el-form-item class="vvv0" label="房屋产权证：" prop="establishmentDate">
										<el-upload class="upload-demo" action="#" :show-file-list="false" :http-request="($event) => { httpRequest($event, 3) }">
											<el-button>
												<el-icon class="el-icon--right">
													<Upload />
												</el-icon>
												<span>上传附件</span>
											</el-button>
										</el-upload>
									</el-form-item> -->
								

							</div>
						</div>
					
						
						<div class="dialog-item right-column" ref="rightColumnItem">
						    <div class="dialog-tbox">
						        <span>操作日志</span>
						    </div>
						    <div class="dialog-cont" style=" width: 1200px;overflow-x: auto;">
						        <div class="step">
						            <div class="step-item" v-for="item in form.logList" :key="item.id">
						               <div class="content">
						                   <div>操作人： {{item.operator}}</div>
						                   <div v-if="item.remark==null">备注：无</div>
						               	<div v-if="item.remark!=null">备注：{{item.remark}}</div>
						                   <div>{{item.createDate}}</div><!----><!---->
						               </div>
						               <div class="bottom">
						                   <div class="text" style="width: 100px;left:-40px;">{{item.operation}}</div>
						                   <div class="round"></div>
						                   <div class="line" v-if="item.status!=7"></div>
						               </div>
						            </div>
						           
						        </div>
						    </div>
						</div>
						
					
					</el-form>

				</div>
			</div>
			<template #footer>
				<div class="dialog-footer">
					<el-button @click="cancel()">取 消</el-button>
					<el-button v-if="form.orderFromDTO.status == 0 || form.orderFromDTO.status == 2" type="primary" @click="submitForm('rightColumn')">确 定</el-button>
				</div>
			</template>
		</el-dialog>


		<el-dialog title="银行卡" v-model="bankdata.open" width="1200px" append-to-body>
			<div class="dialog-custom">


				<!-- 申请批次 -->
				<div class="dialog-main">
					<el-form ref="bankRef" :inline="true" :model="bankdata.form" :rules="bankdata.rules" label-width="140px">
						<!-- 申请信息 -->
						<div class="dialog-item">
							<div class="dialog-tbox">
								<span>银行卡</span>
							</div>
							<div class="dialog-cont">

							<!-- 	<el-form-item label="收款卡类型" prop="cardtype" >
									<div v-if="bankdata.form.isBorrow == 1">未选择</div>
									<el-radio-group v-else @change="($event) => { radioChange($event, 1) }" v-model="bankdata.form.cardtype">
										<el-radio-button label="个人" />
										<el-radio-button label="对公" />
									</el-radio-group>
								</el-form-item>

								<el-form-item label="收款卡所属方" prop="isBorrowText">
									<el-radio-group @change="($event) => { radioChange($event, 2) }" v-model="bankdata.form.isBorrowText">
										<el-radio-button label="借款人" />
									<el-radio-button label="第三方" />
									</el-radio-group>
								</el-form-item> -->

								<el-form-item class="v100" :label="'银行卡正面\n(图片不超过5M\n,jpg,png格式)'" prop="cardFront">
									<el-upload class="upload-demo avatar-uploader" accept="image/jpg,image/jpeg,image/png" action="#" :show-file-list="false" :http-request="($event) => { httpRequest($event, 4) }">
										<el-avatar v-if="bankdata.form.cardFront" :src="checkUrl(bankdata.form.cardFront)" shape="square" :size="178" fit="contain" />
										<el-icon v-else class="avatar-uploader-icon">
											<Plus />
										</el-icon>
									</el-upload>
								</el-form-item>

								<el-form-item label="账户名" prop="cardAccount">
									<el-input class="search-vitem v100" v-model="bankdata.form.cardAccount" placeholder="账户名" clearable />
								</el-form-item>

								<el-form-item label="银行卡号" prop="cardNo">
									<el-input class="search-vitem v100" v-model="bankdata.form.cardNo" placeholder="银行卡号" clearable />
								</el-form-item>
								<!-- <el-form-item label="联行号" prop="bigBankNo">
								    <el-input style="width: 250px;" v-model="bankdata.form.bigBankNo" placeholder="联行号" clearable />
									<span>
									<el-button link type="primary" @click="cardInfo()">查询联行号</el-button>
									</span>
								</el-form-item> -->
								<el-form-item label="所属银行" prop="bankName">
									<!-- <el-select class="search-vitem v100" v-model="bankdata.form.bankName" clearable filterable placeholder="所属银行">
										<el-option v-for="(item, index) in bankdata.banklist" :key="index" :label="item.bankName" :value="item.bankName">
											{{ item.bankName }}
										</el-option>
									</el-select> -->
									<el-input class="search-vitem" v-model="bankdata.form.bankName" placeholder="所属银行" clearable />
								</el-form-item>
								<!-- <el-form-item label="联行号" prop="settleId">
									<el-input class="search-vitem" v-model="bankdata.form.settleId" placeholder="联行号" clearable />
									<el-button type="primary" size="small"  @click="cardInfo()" style="margin-left: 5px;">查询联行号</el-button>
								</el-form-item> -->
								<el-form-item label="预留手机号" prop="phone">
									<el-input class="search-vitem v100" v-model="bankdata.form.phone" placeholder="预留手机号" clearable />
								</el-form-item>

								<el-form-item label="开户证件号" prop="cardIdc">
									<el-input class="search-vitem v60" v-model="bankdata.form.cardIdc" placeholder="开户证件号" clearable />
									<el-select class="search-vitem v40" v-model="bankdata.form.idcType" clearable filterable placeholder="账户类型">
										<el-option :key="1" label="身份证" :value="1"></el-option>
										<!-- <el-option
										  v-for="dict in idc_type"
										  :key="dict.value"
										  :label="dict.label"
										  :value="parseInt(dict.value)"
										/> -->
									</el-select>
								</el-form-item>
								<!-- <el-form-item label="开户证件号" prop="licensePeriod">

                                </el-form-item> -->


							</div>
						</div>

					</el-form>
				</div>

			</div>
			<template #footer>
				<div class="dialog-footer">
					<el-button @click="cancel('bank')">取 消</el-button>
					<el-button type="primary" @click="submitForm('bank')">确 定</el-button>
				</div>
			</template>
		</el-dialog>


		<el-dialog title="预约还款计划" v-model="repaymentdata.open" width="900px" append-to-body>
			<div class="dialog-custom">
				<!-- 预约还款计划 -->
				<div class="dialog-main">
					<el-form ref="repaymentRef" :inline="true" label-width="140px">
						<!-- 预约还款计划 -->
						<div class="dialog-item">
							<div class="dialog-tbox">
								<span>预约还款计划</span>
							</div>
							<div class="dialog-cont">

								<el-form-item class="vvv1" label="借款金额">
									<div>
										{{ formattedNumber(form.borrowInfoFromDTO.borrowAmount) }} 元
									</div>
								</el-form-item>
								<el-form-item class="vvv1" label="借款天数">
									<div>
										{{ form.borrowInfoFromDTO.borrowDays }} 天
									</div>
								</el-form-item>
								<el-form-item class="vvv1" label="还款方式">
									<div>
										 <dict-tag :options="payment_type" :value="form.borrowInfoFromDTO.repaymentType"/> 
										
									</div>
								</el-form-item>
								<el-form-item class="vvv1" label="年利率">
									<div>
										{{ form.borrowInfoFromDTO.borrowRate }} %
									</div>
								</el-form-item>
								<el-form-item class="vvv1" label="还款总和">
									<div>
										{{ formattedNumber(repaymentdata.showdata.monthly) }} 元
									</div>
								</el-form-item>
								<el-form-item class="vvv1" label="利息总和">
									<div>
										{{ formattedNumber(repaymentdata.showdata.monthlyInterest) }} 元
									</div>
								</el-form-item>

								<el-table :data="repaymentdata.list">
									<el-table-column label="还款期数" align="center" prop="periods" />
									<el-table-column label="还款日期" align="center" prop="detailId">
										<template #default="scope">
											<div>
												{{ happenTimeFun(scope.row.repaymentDate, 'yyyy-MM-dd', 0) }}
											</div>
										</template>
									</el-table-column>
									<el-table-column label="总金额" align="center" prop="monthly">
										<template #default="scope">
											<div>
												{{ formattedNumber(scope.row.monthly) }} 元
											</div>
										</template>
									</el-table-column>
									<el-table-column label="本金" align="center" prop="monthlyCapital">
										<template #default="scope">
											<div>
												{{ formattedNumber(scope.row.monthlyCapital) }} 元
											</div>
										</template>
									</el-table-column>
									<el-table-column label="利息" align="center" prop="monthlyInterest">
										<template #default="scope">
											<div>
												{{ formattedNumber(scope.row.monthlyInterest) }} 元
											</div>
										</template>
									</el-table-column>

								</el-table>

							</div>
						</div>



					</el-form>
				</div>






			</div>

		</el-dialog>

		<el-dialog :title="borrowdata.title" v-model="borrowdata.open" width="1200px" append-to-body>
			<div class="dialog-custom">


				<!-- 申请批次 -->
				<div class="dialog-main">
					
						<!-- 申请信息 -->
						<div class="dialog-item">
							<div class="dialog-tbox">
								<span>{{ borrowdata.title }}</span>
							</div>
							<div class="dialog-cont">
								<div class="el-form el-form--default el-form--label-right el-form--inline">
								<el-form-item label="类型" prop="cardtype" label-width="140px">
									<el-radio-group @change="($event) => { radioChange($event, 6) }" v-model="borrowdata.form.cardtype">
										<el-radio-button label="个人" />
										<el-radio-button label="对公" />
									</el-radio-group>
								</el-form-item>

								<el-form-item label="证件类型" prop="cardIdc" label-width="140px">
									<el-select class="search-vitem" v-model="borrowdata.form.idcType" clearable filterable placeholder="证件类型">
										<el-option
										  v-for="dict in idc_type"
										  :key="dict.value"
										  :label="dict.label"
										  :value="parseInt(dict.value)"
										/>
									</el-select>
								</el-form-item>
							</div>
								<!-- 个人 -->
								<template v-if="borrowdata.form.cardtype == '个人'">
								<el-form ref="personRef" :inline="true" :model="persondata.form" :rules="persondata.rules" label-width="140px">
						
									<el-form-item :label="'证件正面\n(图片不超过5M\n,jpg,png格式)'" prop="idcFront" v-if="borrowdata.form.idcType == 1" >
										<el-upload class="upload-demo avatar-uploader" accept="image/jpg,image/jpeg,image/png" action="#" :show-file-list="false" :http-request="($event) => { httpRequestPlus($event, 1,2) }">
											<el-avatar v-if="persondata.form.idcFront" :src="checkUrl(persondata.form.idcFront)" shape="square" :size="178" fit="contain" />
											<el-icon v-else class="avatar-uploader-icon">
												<Plus />
											</el-icon>
										</el-upload>
									</el-form-item>
									
									<el-form-item  class="v100" :label="'证件正面\n(图片不超过5M\n,jpg,png格式)'" prop="idcFront" v-if="borrowdata.form.idcType != 1" >
										<el-upload class="upload-demo avatar-uploader" accept="image/jpg,image/jpeg,image/png" action="#" :show-file-list="false" :http-request="($event) => { httpRequest($event, 2) }">
											<el-avatar v-if="persondata.form.idcFront" :src="checkUrl(persondata.form.idcFront)" shape="square" :size="178" fit="contain" />
											<el-icon v-else class="avatar-uploader-icon">
												<Plus />
											</el-icon>
										</el-upload>
									</el-form-item>

									<el-form-item v-if="borrowdata.form.idcType == 1" :label="'证件反面\n(图片不超过5M\n,jpg,png格式)'" prop="idcBack">
										<el-upload class="upload-demo avatar-uploader" accept="image/jpg,image/jpeg,image/png" action="#" :show-file-list="false" :http-request="($event) => { httpRequestPlus($event, 2,2) }">

											<el-avatar v-if="persondata.form.idcBack" :src="checkUrl(persondata.form.idcBack)" shape="square" :size="178" fit="contain" />
											<el-icon v-else class="avatar-uploader-icon">
												<Plus />
											</el-icon>
										</el-upload>
									</el-form-item>

									<el-form-item label="姓名" prop="name">
										<el-input class="search-vitem" v-model="persondata.form.name" placeholder="姓名" clearable />
									</el-form-item>



									<el-form-item label="手机号码" prop="phone">
										<el-input class="search-vitem" v-model="persondata.form.phone" placeholder="手机号码" clearable />
									</el-form-item>

									<el-form-item label="证件号码" prop="idc">
										<el-input class="search-vitem" v-model="persondata.form.idc" placeholder="证件号码" clearable />
									</el-form-item>

									<el-form-item label="证件生效日期" prop="idcDate">
										<el-date-picker v-model="persondata.form.idcDate" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD" placeholder="证件生效日期" />
									</el-form-item>



									<el-form-item label="证件有效期" prop="idcExpiry">
										<el-date-picker v-model="persondata.form.idcExpiry" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD" placeholder="如果为长期有效，则不填写" />
									</el-form-item>
									<el-form-item label="证件地址" prop="idcAddress">
										<el-input class="search-vitem" v-model="persondata.form.idcAddress" placeholder="证件地址" clearable />
									</el-form-item>

									<el-form-item label="与主借人关系" prop="education">
										<el-select class="search-vitem" v-model="persondata.form.education" clearable filterable placeholder="与主借人关系">
											<el-option
											  v-for="dict in borrower_relation_type"
											  :key="dict.value"
											  :label="dict.label"
											  :value="parseInt(dict.value)"
											/>
										</el-select>
									</el-form-item>

									<el-form-item label="婚姻状况" prop="marriageStatus">
										<el-select class="search-vitem" v-model="persondata.form.marriageStatus" clearable filterable placeholder="婚姻状况">
											<el-option
											  v-for="dict in marriage_status"
											  :key="dict.value"
											  :label="dict.label"
											  :value="parseInt(dict.value)"
											/>
										</el-select>
									</el-form-item>


									<el-form-item class="v100" label="所在地区" prop="citycode">
										<el-cascader class="search-vitem" @change="($event) => { cityChange($event, 3) }" v-model="persondata.form.citycode" :options="cityOpt" :props="CascaderProps" />
										<el-input class="search-vitem v60" v-model="persondata.form.detail" placeholder="街道小区楼栋" clearable />
									</el-form-item>


								</el-form>

								</template>


								<!-- 对公 -->
								<template v-if="borrowdata.form.cardtype == '对公'">
								<el-form ref="companyRef" :inline="true" :model="companydata.form" :rules="companydata.rules" label-width="140px">
									<el-form-item :label="'营业执照\n(图片不超过5M\n,jpg,png格式)'" prop="license" class="vvv1">
										<el-upload class="upload-demo avatar-uploader" accept="image/jpg,image/jpeg,image/png" action="#" :show-file-list="false" :http-request="($event) => { httpRequestPlus($event, 3,3) }">
											<el-avatar v-if="companydata.form.license" :src="checkUrl(companydata.form.license)" shape="square" :size="178" fit="contain" />
											<el-icon v-else class="avatar-uploader-icon">
												<Plus />
											</el-icon>
										</el-upload>
									</el-form-item>
									<el-form-item :label="'证件正面\n(图片不超过5M\n,jpg,png格式)'" prop="idcFront" class="vvv1" v-if="borrowdata.form.idcType == 1">
										<el-upload class="upload-demo avatar-uploader" accept="image/jpg,image/jpeg,image/png" action="#" :show-file-list="false" :http-request="($event) => { httpRequestPlus($event, 1,3) }">
											<el-avatar v-if="companydata.form.idcFront" :src="checkUrl(companydata.form.idcFront)" shape="square" :size="178" fit="contain" />
											<el-icon v-else class="avatar-uploader-icon">
												<Plus />
											</el-icon>
										</el-upload>
									</el-form-item>
									<el-form-item :label="'证件正面\n(图片不超过5M\n,jpg,png格式)'" prop="idcFront" class="vvv1" v-if="borrowdata.form.idcType != 1">
										<el-upload class="upload-demo avatar-uploader" accept="image/jpg,image/jpeg,image/png" action="#" :show-file-list="false" :http-request="($event) => { httpRequest($event, 3) }">
											<el-avatar v-if="companydata.form.idcFront" :src="checkUrl(companydata.form.idcFront)" shape="square" :size="178" fit="contain" />
											<el-icon v-else class="avatar-uploader-icon">
												<Plus />
											</el-icon>
										</el-upload>
									</el-form-item>

									<el-form-item :label="'证件反面\n(图片不超过5M\n,jpg,png格式)'" prop="idcBack" class="vvv1" v-if="borrowdata.form.idcType == 1">
										<el-upload class="upload-demo avatar-uploader" accept="image/jpg,image/jpeg,image/png" action="#" :show-file-list="false" :http-request="($event) => { httpRequestPlus($event, 2,3) }">

											<el-avatar v-if="companydata.form.idcBack" :src="checkUrl(companydata.form.idcBack)" shape="square" :size="178" fit="contain" />
											<el-icon v-else class="avatar-uploader-icon">
												<Plus />
											</el-icon>
										</el-upload>
									</el-form-item>

									<el-form-item class="v100" label="公司名称" prop="companyName">
										<el-input class="search-vitem v60" v-model="companydata.form.companyName" placeholder="公司名称" clearable />
									</el-form-item>



									<el-form-item label="统一信用代码" prop="creditCode">
										<el-input class="search-vitem" v-model="companydata.form.creditCode" placeholder="统一信用代码" clearable />
									</el-form-item>

									<el-form-item label="经办人手机号" prop="phone">
										<el-input class="search-vitem" v-model="companydata.form.phone" placeholder="经办人手机号" clearable />
									</el-form-item>


									<el-form-item class="v100" label="注册地省市区" prop="citycode">
										<el-cascader class="search-vitem" @change="($event) => { cityChange($event, 4) }" v-model="companydata.form.citycode" :options="cityOpt" :props="CascaderProps" />
										<el-input class="search-vitem v60" v-model="companydata.form.detail" placeholder="公司详细地址" clearable />
									</el-form-item>

									<el-form-item label="法人姓名" prop="legalName">
										<el-input class="search-vitem" v-model="companydata.form.legalName" placeholder="法人姓名" clearable />
									</el-form-item>



									<el-form-item label="法人手机号" prop="legalPhone">
										<el-input class="search-vitem" v-model="companydata.form.legalPhone" placeholder="法人手机号" clearable />
									</el-form-item>

									<el-form-item label="证件号码" prop="idc">
										<el-input class="search-vitem" v-model="companydata.form.idc" placeholder="证件号码" clearable />
									</el-form-item>

									<el-form-item label="证件生效日期" prop="idcDate">
										<el-date-picker v-model="companydata.form.idcDate" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD" placeholder="证件生效日期" />
									</el-form-item>



									<el-form-item label="证件有效期" prop="idcExpiry">
										<el-date-picker v-model="companydata.form.idcExpiry" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD" placeholder="如果为长期有效，则不填写" />
									</el-form-item>

									<el-form-item label="证件地址" prop="idcAddress">
										<el-input class="search-vitem" v-model="companydata.form.idcAddress" placeholder="证件地址" clearable />
									</el-form-item>
								</el-form>
								</template>



							</div>
						</div>
					
					
				</div>


			</div>
			<template #footer>
				<div class="dialog-footer">
					<el-button @click="cancel('borrowdata')">取 消</el-button>
					<el-button type="primary" @click="submitForm('borrowdata')">确 定</el-button>
				</div>
			</template>
		</el-dialog>


		<el-dialog title="抵押物" v-model="housedata.open" width="1200px" append-to-body>
			<div class="dialog-custom">

				<!-- 申请批次 -->
				<div class="dialog-main">
					<el-form ref="houseRef" :inline="true" :model="housedata.form" :rules="housedata.rules" label-width="140px">
						<!-- 申请信息 -->
						<div class="dialog-item">
							<div class="dialog-tbox">
								<span>抵押物</span>
							</div>
							<div class="dialog-cont">

								<el-form-item :label="'证件正面\n(图片不超过5M\n,jpg,png格式)'" prop="houseCertificate">
									<el-upload class="upload-demo avatar-uploader" accept="image/jpg,image/jpeg,image/png" action="#" :show-file-list="false" :http-request="($event) => { httpRequest($event, 5) }">
										<el-avatar v-if="housedata.form.houseCertificate" :src="checkUrl(housedata.form.houseCertificate)" shape="square" :size="178" fit="contain" />
										<el-icon v-else class="avatar-uploader-icon">
											<Plus />
										</el-icon>
									</el-upload>
								</el-form-item>

								<el-form-item class="v100" label="所有权人" prop="relationIds">
									<el-select class="search-vitem v60" v-model="housedata.form.relationIds" multiple clearable filterable placeholder="所有权人">
										<!-- <el-option v-for="(item, index) in relaList" :key="index" :label="item.relationName" :value="item.relationId">
										</el-option> -->
										<el-option
										  v-for="item in relaList"
										  :key="item.relationId"
										  :label="item.relationName"
										  :value="item.relationId"
										/>
									</el-select>
									<el-button @click="handleAdd('equitydata')">
										<el-icon class="el-icon--right">
											<Plus />
										</el-icon>
										<span>新增产权人</span>
									</el-button>
								</el-form-item>

								<el-form-item label="权属证书编号" prop="certificateCode">
									<el-input class="search-vitem v100" v-model="housedata.form.certificateCode" placeholder="权属证书编号" clearable />
								</el-form-item>
								<el-form-item label="抵押物地址" prop="houseAddress">
									<el-input class="search-vitem v100" v-model="housedata.form.houseAddress" placeholder="抵押物地址" clearable />
								</el-form-item>
								<el-form-item label="建筑面积" prop="area">
									<el-input class="search-vitem flex_1" v-model="housedata.form.area" placeholder="建筑面积" clearable />
									<span>㎡</span>
								</el-form-item>
								<el-form-item label="评估价值" prop="amount">
									<el-input-number class="search-vitem flex_1" v-model="housedata.form.amount" controls-position="right" />
									<span>万元</span>
								</el-form-item>

								<el-form-item label="使用现状" prop="usingStatus">
									<el-select class="search-vitem v100" v-model="housedata.form.usingStatus" clearable filterable placeholder="使用现状">
										<el-option
										  v-for="dict in house_use_type"
										  :key="dict.value"
										  :label="dict.label"
										  :value="parseInt(dict.value)"
										/>
									</el-select>
								</el-form-item>
								<el-form-item label="拥有现状" prop="houseStatus">
									<el-select class="search-vitem v100" v-model="housedata.form.houseStatus" clearable filterable placeholder="拥有现状">
										<el-option
										  v-for="dict in house_status"
										  :key="dict.value"
										  :label="dict.label"
										  :value="parseInt(dict.value)"
										/>
									</el-select>
								</el-form-item>
								<el-form-item label="持有方式" prop="buyType">
									<el-select class="search-vitem v100" v-model="housedata.form.buyType" clearable filterable placeholder="持有方式">
										<el-option
										  v-for="dict in house_pay_type"
										  :key="dict.value"
										  :label="dict.label"
										  :value="parseInt(dict.value)"
										/>
									</el-select>
								</el-form-item>
								<el-form-item label="权利性质" prop="natureType">
									<el-select class="search-vitem v100" v-model="housedata.form.natureType" clearable filterable placeholder="权利性质">
										<el-option
										  v-for="dict in house_owner_type"
										  :key="dict.value"
										  :label="dict.label"
										  :value="parseInt(dict.value)"
										/>
									</el-select>
								</el-form-item>
								<el-form-item label="区域" prop="citycode">
									<el-cascader class="search-vitem v100" @change="($event) => { cityChange($event, 5) }" v-model="housedata.form.citycode" :options="cityOpt" :props="CascaderProps" />
								</el-form-item>

								<!-- <el-form-item label="是否出租" prop="marriageStatus">
									<el-select class="search-vitem v100" v-model="collateraldata.form.marriageStatus" clearable filterable placeholder="是否出租">
										<el-option v-for="(item, index) in productTypeArr" :key="index" :label="item.dictLabel" :value="item.dictValue">
											{{ item.dictLabel }}
										</el-option>
									</el-select>
								</el-form-item>
								<el-form-item label="房屋性质" prop="marriageStatus">
									<el-select class="search-vitem v100" v-model="collateraldata.form.marriageStatus" clearable filterable placeholder="房屋性质">
										<el-option v-for="(item, index) in productTypeArr" :key="index" :label="item.dictLabel" :value="item.dictValue">
											{{ item.dictLabel }}
										</el-option>
									</el-select>
								</el-form-item>
								<el-form-item label="性质用途" prop="marriageStatus">
									<el-select class="search-vitem v100" v-model="collateraldata.form.marriageStatus" clearable filterable placeholder="性质用途">
										<el-option v-for="(item, index) in productTypeArr" :key="index" :label="item.dictLabel" :value="item.dictValue">
											{{ item.dictLabel }}
										</el-option>
									</el-select>
								</el-form-item>

								<el-form-item label="权利价值" prop="idc">
									<el-input-number class="search-vitem flex_1" v-model="collateraldata.form.idc" controls-position="right" />
									<span> 万元</span>
								</el-form-item>
								<el-form-item label="抵押率" prop="idc">
									<el-input-number class="search-vitem flex_1" v-model="collateraldata.form.idc" controls-position="right" />
									<span>%</span>
								</el-form-item>


								<el-form-item label="存在异议登记" prop="marriageStatus">
									<el-select class="search-vitem v100" v-model="collateraldata.form.marriageStatus" clearable filterable placeholder="存在异议登记">
										<el-option v-for="(item, index) in productTypeArr" :key="index" :label="item.dictLabel" :value="item.dictValue">
											{{ item.dictLabel }}
										</el-option>
									</el-select>
								</el-form-item>

								<el-form-item label="使用权获取方式" prop="marriageStatus">
									<el-select class="search-vitem v100" v-model="collateraldata.form.marriageStatus" clearable filterable placeholder="使用权获取方式">
										<el-option v-for="(item, index) in productTypeArr" :key="index" :label="item.dictLabel" :value="item.dictValue">
											{{ item.dictLabel }}
										</el-option>
									</el-select>
								</el-form-item>


								<el-form-item label="已设定抵押权情况" prop="idc">
									<el-input class="search-vitem v100" v-model="collateraldata.form.idc" placeholder="已设定抵押权情况" clearable />
								</el-form-item> -->




							</div>
						</div>







					</el-form>
				</div>






			</div>
			<template #footer>
				<div class="dialog-footer">
					<el-button @click="cancel('housedata')">取 消</el-button>
					<el-button type="primary" @click="submitForm('housedata')">确 定</el-button>
				</div>
			</template>
		</el-dialog>


		<el-dialog title="提现" v-model="withdrawdata.open" width="600px" append-to-body>
			<div class="dialog-custom">


				<div class="dialog-main">
					<el-form ref="bankRef" :inline="true" :model="withdrawdata.form" :rules="withdrawdata.rules" label-width="140px">
						<div class="dialog-item">
							<div class="dialog-tbox">
								<span>提现</span>
							</div>
							<div class="dialog-cont">
								<el-button plain icon="RefreshRight">刷新</el-button>
								<div class="dialog-box1">
									<el-form-item class="v100" label="对公账户名" prop="idc">
										<div class="">
											对公账户名
										</div>
									</el-form-item>
									<el-form-item class="v100" label="对公开户行号" prop="idc">
										<div class="">
											对公开户行号
										</div>
									</el-form-item>
									<el-form-item class="v100" label="对公账号" prop="idc">
										<div class="">
											对公账号
										</div>
									</el-form-item>
									<el-form-item class="v100" label="对公绑定银行" prop="idc">
										<div class="">
											对公绑定银行
										</div>
									</el-form-item>
								</div>



								<el-form-item class="v100" label="提现金额" prop="idc">
									<el-input class="search-vitem flex_1" v-model="collateraldata.form.idc" placeholder="提现金额" clearable />
									<el-button @click="handleAdd('withdrawdatalist')" style="margin-left: 10px;" type="danger" plain>提现记录</el-button>
								</el-form-item>

								<el-form-item class="v100" label="请输入支付密码" prop="idc">
									<el-input class="search-vitem v100" type="password" show-password v-model="collateraldata.form.idc" placeholder="请输入支付密码" clearable />
								</el-form-item>


								<div class="flex-end">
									<div @click="handleAdd('pwddata')">
										找回密码
									</div>
									<div @click="handleAdd('editbank')" style="margin-left: 10px;">
										修改绑定银行
									</div>

								</div>




							</div>
						</div>







					</el-form>
				</div>






			</div>
			<template #footer>
				<div class="dialog-footer">
					<el-button @click="cancel('withdrawdata')">取 消</el-button>
					<el-button type="primary" @click="submitForm('withdrawdata')">确 定</el-button>
				</div>
			</template>
		</el-dialog>



		<el-dialog title="提现记录" v-model="withdrawdata.listopen" width="1200" append-to-body>
			<div class="dialog-custom">


				<div class="dialog-main">
					<el-form ref="bankRef" :inline="true" :model="withdrawdata.listform" :rules="withdrawdata.rules" label-width="80px">
						<div class="dialog-item">
							<div class="dialog-tbox">
								<span>提现记录</span>
							</div>
							<div class="dialog-cont">


								<el-form-item class="vvv1" label="申请日期" prop="idc">
									<el-date-picker class="search-vitem flex_1" v-model="withdrawdata.listform.idc" type="daterange" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" :size="size" />
								</el-form-item>
								<el-form-item class="vvv1" label="状态" prop="idc">
									<el-select class="search-vitem flex_1" v-model="withdrawdata.listform.repaymentType" clearable filterable placeholder="状态">
										<el-option v-for="(item, index) in paymentTypeArr" :key="index" :label="item.dictLabel" :value="item.dictValue">
											{{ item.dictLabel }}
										</el-option>
									</el-select>
								</el-form-item>
								<el-form-item class="vvv1">
									<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
									<el-button icon="Refresh" @click="resetQuery">重置</el-button>
								</el-form-item>

								<div>
									<el-table v-loading="loading" :data="orderArray" @selection-change="handleSelectionChange">
										<el-table-column label="交易流水号" align="center" prop="userId" />
										<el-table-column label="金额" align="center" prop="borrowerName" />
										<el-table-column label="状态" align="center" prop="borrowAmount" />
										<el-table-column label="申请时间" align="center" prop="unPayAmount" />
									</el-table>

									<pagination v-show="total > 0" :total="total" :page="queryParams.pageNum" :limit="queryParams.pageSize" @pagination="getList" />

								</div>


							</div>
						</div>







					</el-form>
				</div>






			</div>
		</el-dialog>


		<el-dialog title="找回密码" v-model="pwddata.open" width="600px" append-to-body>
			<div class="dialog-custom">

				<div class="dialog-main">
					<el-form ref="bankRef" :inline="true" :model="pwddata.form" :rules="pwddata.rules" label-width="140px">
						<div class="dialog-item">
							<div class="dialog-tbox">
								<span>找回密码</span>
							</div>
							<div class="dialog-cont">

								<div class="c-tips">
									<el-icon class="icon">
										<WarningFilled />
									</el-icon>
									<div class="c-t">支付密码支持6-12位的字母、数字，不可以是连续或重复的数字。请妥善保管支付密码，切勿外泄！</div>
								</div>

								<el-form-item class="v100" label="请输入新密码" prop="idc">
									<el-input class="search-vitem v100" type="password" show-password v-model="pwddata.form.idc" placeholder="请输入新密码" clearable />
								</el-form-item>
								<el-form-item class="v100" label="验证码" prop="idc">
									<el-input class="search-vitem flex_1" v-model="pwddata.form.idc" placeholder="验证码" clearable />
									<el-button style="margin-left: 10px;" type="danger" plain>获取验证码</el-button>
								</el-form-item>



							</div>
						</div>

					</el-form>
				</div>

			</div>
			<template #footer>
				<div class="dialog-footer">
					<el-button @click="cancel('pwddata')">取 消</el-button>
					<el-button type="primary" @click="submitForm('pwddata')">确 定</el-button>
				</div>
			</template>
		</el-dialog>

		<el-dialog title="修改绑定银行" v-model="editbank.open" width="600px" append-to-body>
			<div class="dialog-custom">
				<div class="dialog-main">
					<el-form ref="bankRef" :inline="true" :model="editbank.form" :rules="editbank.rules" label-width="140px">
						<div class="dialog-item">
							<div class="dialog-tbox">
								<span>修改绑定银行</span>
							</div>
							<div class="dialog-cont">
								<el-form-item class="v100" label="对公账户名" prop="idc">
									<el-input class="search-vitem v100" v-model="editbank.form.idc" placeholder="对公账户名" clearable />
								</el-form-item>
								<el-form-item class="v100" label="对公账户开户行号" prop="idc">
									<el-input class="search-vitem v100" v-model="editbank.form.idc" placeholder="对公账户开户行号" clearable />
								</el-form-item>
								<el-form-item class="v100" label="绑定银行" prop="idc">
									<el-select class="search-vitem v100" v-model="editbank.form.bankName" clearable filterable placeholder="所属银行">
										<el-option v-for="(item, index) in bankdata.banklist" :key="index" :label="item.bankName" :value="item.bankName">
											{{ item.bankName }}
										</el-option>
									</el-select>
								</el-form-item>
								<el-form-item class="v100" label="绑定银行账号" prop="idc">
									<el-input class="search-vitem v100" v-model="editbank.form.idc" placeholder="绑定银行账号" clearable />
								</el-form-item>
								<el-form-item class="v100" label="请输入支付密码" prop="idc">
									<el-input class="search-vitem v100" type="password" show-password v-model="editbank.form.idc" placeholder="请输入支付密码" clearable />
								</el-form-item>
							</div>
						</div>
					</el-form>
				</div>
			</div>
			<template #footer>
				<div class="dialog-footer">
					<el-button @click="cancel('editbank')">取 消</el-button>
					<el-button type="primary" @click="submitForm('editbank')">确 定</el-button>
				</div>
			</template>
		</el-dialog>


		<el-dialog title="更换手机号" v-model="editphone.open" width="600px" append-to-body>
			<div class="dialog-custom">
				<div class="dialog-main">
					<el-form ref="bankRef" :inline="true" :model="editphone.form" :rules="editphone.rules" label-width="140px">
						<div class="dialog-item">
							<div class="dialog-tbox">
								<span>更换手机号</span>
							</div>
							<div class="dialog-cont">
								<el-form-item class="v100" label="原绑定手机号" prop="idc">
									<el-input class="search-vitem v100" v-model="editphone.form.idc" placeholder="原绑定手机号" clearable />
								</el-form-item>
								<el-form-item class="v100" label="新绑定手机号" prop="idc">
									<el-input class="search-vitem v100" v-model="editphone.form.idc" placeholder="新绑定手机号" clearable />
								</el-form-item>
								<el-form-item class="v100" label="请输入支付密码" prop="idc">
									<el-input class="search-vitem v100" type="password" show-password v-model="editphone.form.idc" placeholder="请输入支付密码" clearable />
								</el-form-item>
							</div>
						</div>
					</el-form>
				</div>
			</div>
			<template #footer>
				<div class="dialog-footer">
					<el-button @click="cancel('editphone')">取 消</el-button>
					<el-button type="primary" @click="submitForm('editphone')">确 定</el-button>
				</div>
			</template>
		</el-dialog>


		<el-dialog title="修改支付密码" v-model="editpaypwd.open" width="600px" append-to-body>
			<div class="dialog-custom">
				<div class="dialog-main">
					<el-form ref="bankRef" :inline="true" :model="editpaypwd.form" :rules="editpaypwd.rules" label-width="140px">
						<div class="dialog-item">
							<div class="dialog-tbox">
								<span>修改支付密码</span>
							</div>
							<div class="dialog-cont">
								<el-form-item class="v100" label="请输入原密码" prop="idc">
									<el-input class="search-vitem v100" type="password" show-password v-model="editpaypwd.form.idc" placeholder="请输入原密码" clearable />
								</el-form-item>
								<el-form-item class="v100" label="请输入新密码" prop="idc">
									<el-input class="search-vitem v100" type="password" show-password v-model="editpaypwd.form.idc" placeholder="请输入新密码" clearable />
								</el-form-item>

								<div class="flex-end">
									<div @click="handleAdd('pwddata')">
										找回密码
									</div>


								</div>

							</div>
						</div>
					</el-form>
				</div>
			</div>
			<template #footer>
				<div class="dialog-footer">
					<el-button @click="cancel('editpaypwd')">取 消</el-button>
					<el-button type="primary" @click="submitForm('editpaypwd')">确 定</el-button>
				</div>
			</template>
		</el-dialog>
		
		
		<el-dialog title="机构认证授权" v-model="orgSign.open" width="600px" append-to-body>
			<div class="dialog-custom">
				<div class="dialog-main">
					<el-form ref="signRef" :inline="true" :model="orgSign.form" :rules="orgSign.rules" label-width="140px">
						<div class="dialog-item">
							<div class="dialog-tbox">
								<span>机构认证授权</span>
							</div>
							<div class="dialog-cont">
								<el-form-item class="v100" label="1.机构签名授权" prop="authUrl">
									<template v-if="orgSign.form.authUrl!=null && orgSign.form.status==1">
										<a v-bind:href="orgSign.form.authUrl" target="_blank" class="link-type">
										   <span>去授权</span>
										</a>
									</template>
									<template v-else-if="orgSign.form.status>1">
										 <span>已授权</span>
									</template>	
									<template v-else>
										 <span style="color: #FF6201;">稍等，授权信息生成中</span>
									</template>
								</el-form-item>
								<el-form-item class="v100" label="2.机构签章授权" prop="signtUrl">
									<template v-if="orgSign.form.signUrl!=null && orgSign.form.status==2">
										<a v-bind:href="orgSign.form.signUrl" target="_blank" class="link-type">
										   <span>去授权</span>
										</a>
									</template>
									<template v-else-if="orgSign.form.status>2">
										 <span>已授权</span>
									</template>	
									<template v-else>
										 <span style="color: #FF6201;">稍等，授权信息生成中</span>
									</template>
								</el-form-item>
							</div>
						</div>
					</el-form>
				</div>
			</div>
			<template #footer>
				<div class="dialog-footer">
					
					<el-button type="primary" @click="submitForm('orgSign')">我已授权</el-button>
				</div>
			</template>
		</el-dialog>



		<el-dialog title="订单驳回" v-model="orderhandle.open" width="600px" append-to-body>
			<div class="dialog-custom">
				<div class="dialog-main">
					<el-form ref="orderhandleRef" :inline="true" :model="orderhandle.form" :rules="orderhandle.rules" label-width="140px">
						<div class="dialog-item">
						
							<div class="dialog-cont">
								<el-form-item class="v100" label="驳回原因" prop="remark">
									<el-input class="search-vitem v100" type="textarea" v-model="orderhandle.form.remark" placeholder="驳回原因" clearable />
								</el-form-item>
								
							</div>
						</div>
					</el-form>
				</div>
			</div>
			<template #footer>
				<div class="dialog-footer">
					<el-button @click="cancel('orderhandle')">取 消</el-button>
					<el-button type="primary" @click="submitForm('orderhandle')">确 定</el-button>
				</div>
			</template>
		</el-dialog>
		
		<el-dialog title="订单放款" v-model="transferdata.open" width="600px" append-to-body>
			<div class="dialog-custom">
				<div class="dialog-main">
					<el-form ref="transferRef" :inline="true" :model="transferdata.form" :rules="transferdata.rules" label-width="140px">
						<div class="dialog-item">
						
							<div class="dialog-cont">
								<el-form-item class="v100" label="可放款金额(元)">
									{{form.borrowInfoFromDTO.borrowAmount-form.borrowInfoFromDTO.applyTransferAmount}}
								</el-form-item>
								<el-form-item class="v100" label="放款金额(元)" prop="amount">
									<el-input-number class="search-vitem" min="1" v-model="transferdata.form.amount" controls-position="right" @change="changeAmount"/>
								</el-form-item>
								<el-form-item class="v100" label="通道费(元)">
									{{Account.channelAmount}}
								</el-form-item>
							</div>
						</div>
					</el-form>
				</div>
			</div>
			<template #footer>
				<div class="dialog-footer">
					<el-button @click="cancel('transferdata')">取 消</el-button>
					<el-button type="primary" @click="submitForm('transferdata')">确 定</el-button>
				</div>
			</template>
		</el-dialog>




	</div>
</template>

<script setup name="Company">
	import { ElMessage, ElLoading } from 'element-plus';
	import {getCardInfo} from "@/api/tool/tool";
	import { userListOrg,getUserOrg,getUserOrgRefresh,getUserOrgSign } from "@/api/company/org";
	import { updateStatus,delCompany,delPerson,delHouse,delCard,OrderHouseInfo,OrderCardInfo,OrderPersonInfo,OrderCompanyInfo,orderDetail,saveOrderCompany,saveOrderPersonal,relationList,saveHouse,saveCompany,savePerson,saveCard,getPerId,IdCardOCRBack,IdCardOCRFace,BusinessLicense,orderList, regionList, uploadByServer, publicList, RepaymentList, formattedNumber, priceSwitch, happenTimeFun, objectFun, checkUrl, BankList, addTransfer,getProductList,getProductConfigList } from "@/api/user/order";
	import { AccountInfo } from "@/api/user/account";
	const { proxy } = getCurrentInstance();
	const { transfer_status,house_owner_type,house_pay_type,house_status,house_use_type,sys_user_sex,borrower_relation_type,idc_type,order_status,org_files_type,payment_type,borrow_use_type,education,marriage_status,job_type,post_name,businesses_type } = proxy.useDict('transfer_status','house_owner_type','house_pay_type','house_status','house_use_type','sys_user_sex','borrower_relation_type','idc_type','order_status', 'org_files_type','payment_type','borrow_use_type','education','marriage_status','job_type','post_name','businesses_type');
	const orgList = ref([]);
	const productList = ref([]);
	const relaList = ref([]);
	const orderArray = ref([]);
	const open = ref(false);
	const loading = ref(true);
	const showSearch = ref(true);
	const ids = ref([]);
	const single = ref(true);
	const multiple = ref(true);
	const total = ref(0);
	const title = ref("");
	const perOrderId = ref(0);
	const imageUrl = ref("");
	const imageUrl2 = ref("");


	import icon_house from '@/assets/rong/icon_house.png'

	const data = reactive({

		Account: {
			tenantId: null,
			companyName: null,
			aviAmount: null,
			totalAmount: null,
			payAmount: null,
			freezAmount: null,
			bankName: null,
			cardNo: null,
			openBank: null,
			channelAmount: 0,
		},
		// 省市区 参数
		CascaderProps: {
			value: 'name',
			label: 'name',
			children: 'list',
		},
		cityOpt: [],
		// 省市区 参数 END
		//订单驳回
		orderhandle: {
			open: false,
			form: {
				status: 2,
				remark: '',
				orderId: null,
			},
			rules: {
				'remark': [
					{ required: true, message: "驳回原因不能为空", trigger: "blur" }
				],
			}
		},
		transferdata: {
			open: false,
			form: {
				amount: null,
				cardId: null,
			},
			resetForm: {
				amount: null,
				cardId:null
				},
			rules: {
				'amount': [
					{ required: true, message: "放款金额不能为空", trigger: "blur" }
				],
			}
		},
		orgAccount: {
			tenantId: null,
			walletNo: null,
			accountNo: null,
			htAccountNo: null,
			balance: null,
			frozenAmount: null,
			availAmount: null,
			orgName: null
		},
		orgSign: {
			open: false,
			form: {
				authUrl: null,
				signUrl: null,
				status: null
			},
			
		},
		// 修改支付密码
		editpaypwd: {
			open: false,
			form: {
				"cardtype": '个人', // 1 = 个人 2 = 对公
				"bigBankNo": '', // 大额银行行号
			},
			list: [],
			rules: {
				'isBorrowText': [
					{ required: true, message: "收款卡所属方不能为空", trigger: "blur" }
				],
			}
		},

		// 修改绑定银行
		editphone: {
			open: false,
			form: {
				"cardtype": '个人', // 1 = 个人 2 = 对公
				"bigBankNo": '', // 大额银行行号
			},
			list: [],
			rules: {
				'isBorrowText': [
					{ required: true, message: "收款卡所属方不能为空", trigger: "blur" }
				],
			}
		},

		// 修改绑定银行
		editbank: {
			open: false,
			form: {
				"cardtype": '个人', // 1 = 个人 2 = 对公
				"bigBankNo": '', // 大额银行行号
			},
			list: [],
			rules: {
				'isBorrowText': [
					{ required: true, message: "收款卡所属方不能为空", trigger: "blur" }
				],
			}
		},


		// 找回密码
		pwddata: {
			open: false,
			form: {
				"cardtype": '个人', // 1 = 个人 2 = 对公
				"bigBankNo": '', // 大额银行行号
			},
			list: [],
			rules: {
				'isBorrowText': [
					{ required: true, message: "收款卡所属方不能为空", trigger: "blur" }
				],
			}
		},


		// 提现
		withdrawdata: {
			open: false,
			form: {
				"cardtype": '个人', // 1 = 个人 2 = 对公
				"bigBankNo": '', // 大额银行行号
			},
			listopen: false,
			listform: {},
			list: [],
			rules: {
				'isBorrowText': [
					{ required: true, message: "收款卡所属方不能为空", trigger: "blur" }
				],
			}
		},


		// 抵押物
		housedata:{
			title: '抵押物',
			open: false,
			form:{},
			resetForm:{
				citycode:[],
				relationIds:[],
				orderId: null,
				houseId: null,
				ownerType: null,
				relationId: null,
				houseCertificate: null,
				certificateCode: null,
				province: null,
				city: null,
				district: null,
				houseAddress: null,
				area: null,
				amount: null,
				usingStatus: null,
				houseStatus: null,
				buyType: null,
				natureType: null
			},
			rules: {
				citycode: [
			      { required: true, message: "区域不能为空", trigger: "blur" }
			    ],
			    relationIds: [
			      { required: true, message: "产权人不能为空", trigger: "blur" }
			    ],
				houseCertificate: [
				  { required: true, message: "房产证件不能为空", trigger: "blur" }
				],
				certificateCode: [
				  { required: true, message: "证书编号不能为空", trigger: "blur" }
				],
			    houseAddress: [
			      { required: true, message: "抵押物地址不能为空", trigger: "blur" }
			    ],
			    area: [
			      { required: true, message: "建筑面积不能为空", trigger: "blur" }
			    ],
			    amount: [
			      { required: true, message: "评估价格不能为空", trigger: "blur" }
			    ],
			    usingStatus: [
			      { required: true, message: "使用现状不能为空", trigger: "blur" }
			    ],
			    houseStatus: [
			      { required: true, message: "拥有现状不能为空", trigger: "blur" }
			    ],
				buyType: [
			      { required: true, message: "持有方式不能为空", trigger: "blur" }
			    ],
				natureType: [
			      { required: true, message: "权利性质不能为空", trigger: "blur" }
			    ]
			  }
		},
		// 共借人
		persondata:{
			form: {},
			resetForm: {
				houseId:null,
				citycode:[],
				personId: null,
				orderId: null,
				idcFront: null,
				idcBack: null,
				idcType: null,
				name: null,
				idc: null,
				brithDate: null,
				idcDate: null,
				idcExpiry: null,
				idcAddress: null,
				province: null,
				city: null,
				district: null,
				detail: null,
				phone: null,
				education: null,
				nation: null,
				marriageStatus: null,
				sex: null,
				company: null,
				post: null,
				postTitle: null,
				companyType: null,
				companyTel: null,
				role: null,
				relationType: null
			},
			rules: {
				citycode: [
				  { required: true, message: "所在区域不能为空", trigger: "blur" }
				],
			    idcFront: [
			      { required: true, message: "证件正面不能为空", trigger: "blur" }
			    ],
				idcBack: [
				  { required: true, message: "证件反面不能为空", trigger: "blur" }
				],
			    name: [
			      { required: true, message: "名字不能为空", trigger: "blur" }
			    ],
			    idc: [
			      { required: true, message: "证件号码不能为空", trigger: "blur" }
			    ],
			    brithDate: [
			      { required: true, message: "出生日期不能为空", trigger: "blur" }
			    ],
			    idcDate: [
			      { required: true, message: "证件生效日期不能为空", trigger: "blur" }
			    ],
			    idcAddress: [
			      { required: true, message: "证件地址不能为空", trigger: "blur" }
			    ],
			    detail: [
			      { required: true, message: "详细地址不能为空", trigger: "blur" }
			    ],
			    phone: [
			      { required: true, message: "联系电话不能为空", trigger: "blur" },
				  { pattern: /^1[3456789]\d{9}$/, message: '手机号码不格式不正确', trigger: 'blur' }
			    ]
			  }
		},
		
		companydata:{
			form: {},
			resetForm: {
				houseId:null,
				citycode:[],
				companyId: null,
				orderId: null,
				license: null,
				companyName: null,
				creditCode: null,
				licenseExpiry: null,
				companyDate: null,
				province: null,
				city: null,
				district: null,
				detail: null,
				phone: null,
				companyTel: null,
				companyType: null,
				companyCapital: null,
				companyBusiness: null,
				legalName: null,
				legalPhone: null,
				idc: null,
				idcDate: null,
				idcExpiry: null,
				idcAddress: null,
				idcType: null,
				idcFront: null,
				idcBack: null,
				role: null
			},
			rules: {
				license: [
			      { required: true, message: "营业执照不能为空", trigger: "blur" }
			    ],
			    idcFront: [
			      { required: true, message: "法人证件正面不能为空", trigger: "blur" }
			    ],
				idcBack: [
				  { required: true, message: "法人证件反面不能为空", trigger: "blur" }
				],
				creditCode: [
				  { required: true, message: "信用代码不能为空", trigger: "blur" }
				],
			    companyName: [
			      { required: true, message: "公司名称不能为空", trigger: "blur" }
			    ],
			    idc: [
			      { required: true, message: "证件号码不能为空", trigger: "blur" }
			    ],
			    legalName: [
			      { required: true, message: "法人姓名不能为空", trigger: "blur" }
			    ],
			    idcDate: [
			      { required: true, message: "证件生效日期不能为空", trigger: "blur" }
			    ],
			    idcAddress: [
			      { required: true, message: "证件地址不能为空", trigger: "blur" }
			    ],
				citycode: [
			      { required: true, message: "注册地区不能为空", trigger: "blur" }
			    ],
			    detail: [
			      { required: true, message: "详细地址不能为空", trigger: "blur" }
			    ],
			    phone: [
			      { required: true, message: "联系电话不能为空", trigger: "blur" },
				  { pattern: /^1[3456789]\d{9}$/, message: '手机号码不格式不正确', trigger: 'blur' }
			    ]
			  }
		},

		borrowdata: {
			title: '共借人',
			open: false,
			form: {
				"cardtype": '个人', // 1 = 个人 2 = 对公
				"idcType": 1, // 证件类型
				"role": null, // 角色类型 0借款人，1共借人，2担保人，3抵押权人
			},
		},

		// 银行卡信息
		bankdata: {
			open: false,
			banklist: [], // 所属银行列表
			form: {},
			resetForm: {
				cardId:null,
				"orderId": null, // 订单id
				"cardtype": '个人', // 1 = 个人 2 = 对公
				"settleId": '', // 联行号
				"bankName": "", // 银行名称
				"bankType": '', // 账户银行类型
				"cardAccount": "", // 账户名
				"cardFront": "", // 银行卡照片
				"cardIdc": "", // 证件号码
				"cardNo": "", // 卡号
				"idcType": 1, // 证件类型：1身份证，2港澳通行证，3台湾通行证，4护照
				"isBorrow": 1, // 是否为借款人卡
				"isBorrowText": '借款人',
				"phone": "" // 预留手机号
			},
			rules: {
				'isBorrowText': [
					{ required: true, message: "收款卡所属方不能为空", trigger: "blur" }
				],
				'cardFront': [
					{ required: true, message: "银行卡正面不能为空", trigger: "blur" }
				],
				'cardAccount': [
					{ required: true, message: "账户名不能为空", trigger: "blur" }
				],
				'cardNo': [
					{ required: true, message: "银行卡号不能为空", trigger: "blur" }
				],
				// 'settleId': [
				// 	{ required: true, message: "联行号不能为空", trigger: "blur" }
				// ],
				'phone': [
					{ required: true, message: "预留手机号不能为空", trigger: "blur" },
					{ pattern: /^1[3456789]\d{9}$/, message: '手机号码不格式不正确', trigger: 'blur' }
				],
				'cardIdc': [
					{ required: true, message: "开户证件号不能为空", trigger: "blur" }
				],
				'bankName': [
					{ required: true, message: "所属银行不能为空", trigger: "blur" }
				],
			}
		},

		// 预约还款计划
		repaymentdata: {
			open: false,
			showdata: {},
			list: [],
		},

		form: {},
		resetForm: {
			logList: [],
			orderGJList:[],
			orderDBList:[],
			houseList:[],
			cardFromDTOList:[],
			borrowInfoFromDTO: { // 借款信息
				citycode: [],
				advanceRate: null,
				beginDate: null,
				borrowAmount: null,
				borrowDays: null,
				borrowRate: null,
				borrowType: null,
				endDate: null,
				repaymentType: null,
				resolutionType: null,
				signCity: null,
				signDistrict: null,
				signProvince: null
			},
			company: {
				citycode:[],
				companyId: null,
				orderId: null,
				license: null,
				companyName: null,
				creditCode: null,
				licenseExpiry: null,
				companyDate: null,
				province: null,
				city: null,
				district: null,
				detail: null,
				phone: null,
				companyTel: null,
				companyType: null,
				companyCapital: null,
				companyBusiness: null,
				legalName: null,
				legalPhone: null,
				idc: null,
				idcDate: null,
				idcExpiry: null,
				idcAddress: null,
				idcType: 1,
				idcFront: null,
				idcBack: null,
				role: 0
			},
			"orderFile":{
				"borrowFile":null,
				"dyFile":null,
				"zzFile":null,
				"bzFile":null,
				"zxFile":null,
				"houseFile":null,
				"otherFile":null,
			},
			"orderFromDTO": {
				"id": null,
				"contractType": 2,
				"contractTypeText": '线下', // 合同签署方式：1在线，2线下
				"contractNo": null,
				"tenantId": null,
				"borrowerType": 1,
				"borrowerTypeText": '个人', // 借款人类型：1个人，2企业
				"channelType": 1, // 支付渠道
				"guaranteeContractType": '', // 担保合同签署方式：1在线，2线下
				"isGuarantee": 0, // 是否有担保
				"orgId": '', // 小贷机构id
				"productType": null, // 产品类型
				"source": '1', // 订单来源：1pc
				"status": 0,
				"channelRate": 0,// 通道费率
				"limitAmount": 0,// 最低通道费
			},
			personal: {
				citycode:[],
				personId: null,
				orderId: null,
				idcFront: null,
				idcBack: null,
				idcType: 1,
				name: null,
				idc: null,
				brithDate: null,
				idcDate: null,
				idcExpiry: null,
				idcAddress: null,
				province: null,
				city: null,
				district: null,
				detail: null,
				phone: null,
				education: null,
				nation: null,
				marriageStatus: null,
				sex: null,
				company: null,
				post: null,
				postTitle: null,
				companyType: null,
				companyTel: null,
				role: 0,
				relationType: null
			}
		},
		queryParams: {
			pageNum: 1,
			pageSize: 10,
			orderNo: null,
			borrowerName: null,
			status: null,
		},
		rules: {
			'orderFile.borrowFile': [
				{ required: true, message: "请上传借款合同", trigger: "blur" }
			],
			'orderFromDTO.tenantId': [
				{ required: true, message: "受让方不能为空", trigger: "blur" }
			],
			'orderFromDTO.contractNo': [
				{ required: true, message: "合同编号不能为空", trigger: "blur" }
			],
			'orderFromDTO.orgId': [
				{ required: true, message: "小贷机构不能为空", trigger: "blur" }
			],
			'orderFromDTO.borrowerTypeText': [
				{ required: true, message: "借款人类型不能为空", trigger: "blur" }
			],
			'borrowInfoFromDTO.borrowAmount': [
				{ required: true, message: "借款金额不能为空", trigger: "blur" }
			],

			'borrowInfoFromDTO.borrowType': [
				{ required: true, message: "借款用途不能为空", trigger: "blur" }
			],
			'borrowInfoFromDTO.borrowDays': [
				{ required: true, message: "借款天数不能为空", trigger: "blur" }
			],
			'borrowInfoFromDTO.beginDate': [
				{ required: true, message: "借款起始日期不能为空", trigger: "blur" }
			],
			'borrowInfoFromDTO.repaymentType': [
				{ required: true, message: "还款方式不能为空", trigger: "blur" }
			],
			'borrowInfoFromDTO.borrowRate': [
				{ required: true, message: "借款年利率不能为空", trigger: "blur" }
			],
			'borrowInfoFromDTO.resolutionType': [
				{ required: true, message: "解决争议方式不能为空", trigger: "blur" }
			],
			'borrowInfoFromDTO.citycode': [
				{ required: true, message: "签约地不能为空", trigger: "blur" }
			],

			'personal.idcType': [
				{ required: true, message: "证件类型不能为空", trigger: "blur" }
			],
			'personal.idcFront': [
				{ required: true, message: "证件正面不能为空", trigger: "blur" }
			],
			'personal.idcBack': [
				{ required: true, message: "证件反面不能为空", trigger: "blur" }
			],
			'personal.name': [
				{ required: true, message: "主借人不能为空", trigger: "blur" }
			],
			'personal.idc': [
				{ required: true, message: "证件号码不能为空", trigger: "blur" }
			],
			'personal.brithDate': [
				{ required: true, message: "出生年月不能为空", trigger: "blur" }
			],
			'personal.idcDate': [
				{ required: true, message: "证件生效日期不能为空", trigger: "blur" }
			],
			'personal.idcAddress': [
				{ required: true, message: "身份证地址不能为空", trigger: "blur" }
			],
			'personal.citycode': [
				{ required: true, message: "所在地区不能为空", trigger: "blur" }
			],
			'personal.phone': [
				{ required: true, message: "手机号码不能为空", trigger: "blur" },
				{ pattern: /^1[3456789]\d{9}$/, message: '手机号码不格式不正确', trigger: 'blur' }
			],
			'personal.sexText': [
				{ required: true, message: "性别不能为空", trigger: "blur" }
			],
			'company.license': [
			  { required: true, message: "营业执照不能为空", trigger: "blur" }
			],
			'company.idcFront': [
			  { required: true, message: "法人证件正面不能为空", trigger: "blur" }
			],
			'company.idcBack': [
			  { required: true, message: "法人证件反面不能为空", trigger: "blur" }
			],
			'company.creditCode': [
			  { required: true, message: "信用代码不能为空", trigger: "blur" }
			],
			'company.companyName': [
			  { required: true, message: "公司名称不能为空", trigger: "blur" }
			],
			'company.idc': [
			  { required: true, message: "证件号码不能为空", trigger: "blur" }
			],
			'company.legalName': [
			  { required: true, message: "法人姓名不能为空", trigger: "blur" }
			],
			'company.idcDate': [
			  { required: true, message: "证件生效日期不能为空", trigger: "blur" }
			],
			'company.idcAddress': [
			  { required: true, message: "证件地址不能为空", trigger: "blur" }
			],
			'company.citycode': [
			  { required: true, message: "注册地区不能为空", trigger: "blur" }
			],
			'company.detail': [
			  { required: true, message: "详细地址不能为空", trigger: "blur" }
			],
			'company.phone': [
			  { required: true, message: "联系电话不能为空", trigger: "blur" },
			  { pattern: /^1[3456789]\d{9}$/, message: '联系电话不格式不正确', trigger: 'blur' }
			],
		},

		leftNavigationItems: ['受让方信息', '主借人信息', '借款信息', '共借人信息', '担保人信息', '抵押物信息', '收款卡信息', '其他附件','操作日志']
	});




	const {orgSign,Account,transferdata,orgAccount,orderhandle,housedata,persondata,companydata,leftNavigationItems, queryParams, form, resetForm, rules, withdrawdata, bankdata, CascaderProps, cityOpt, repaymentdata, borrowdata, pwddata, editbank, editphone, editpaypwd } = toRefs(data);



	// 弹出层 滚动条

	const activeNavigation = ref(0);
	const rightColumn = ref(null);
	const isLock = ref(false);
	
	function getAccountInfo() {
	    AccountInfo({}).then(response => {
	        var data = response.data;
			Account.value=data
	    });
	}
	
	function changeAmount(){
		
		var channelAmount=transferdata.value.form.amount*form.value.orderFromDTO.channelRate;
		if(channelAmount>form.value.orderFromDTO.limitAmount)
		{
			Account.value.channelAmount=channelAmount;
		}
		else
		{
			Account.value.channelAmount=form.value.orderFromDTO.limitAmount;
		}
		
	}

	function selectNavigation(index) {
		// 开锁
		isLock.value = true
		activeNavigation.value = index;
		const rightColumnElement = rightColumn.value.$el;
		
		// console.log(rightColumnElement);
		
		// const targetElement = document.querySelectorAll('.right-column');
		const targetElement = document.querySelectorAll('.right-column')[index];
		
		// console.log(targetElement);
		
		targetElement.scrollIntoView({ behavior: 'smooth', block: 'start' });

		setTimeout(() => {
			//关锁
			isLock.value = false
		}, 2000)
	}

	function changeType() {
		currentIndex.value = val

		// 获取选中的dom元素
		const typeItemDom = shop.value[val]

		// 开锁
		isLock.value = true

		// 第一个参数为水平方向，第二个参数为纵轴方向
		window.scrollTo(0, typeItemDom.offsetTop)

		setTimeout(() => {
			//关锁
			isLock.value = false
		}, 0)
	}


	function cccc() {
		// 锁关了滚动事件才有效
		if (!isLock.value) {
			types.value.forEach((item, index) => {
				const shopItemDom = shop.value[index]

				// 每个模块距离顶部的距离
				const offsetTop = shopItemDom.offsetTop

				// 页面滚动的距离
				const scrollTop = document.documentElement.scrollTop

				if (scrollTop >= offsetTop) {
					// 给左边分类设置激活的效果
					currentIndex.value = index
				}
			})
		}
	}


	function handleScroll() {
		
		if (!isLock.value && open.value==true) {

		const scrollTop = rightColumn.value.$el.scrollTop;
		const scrollHeight = rightColumn.value.$el.scrollHeight;
		const clientHeight = rightColumn.value.$el.clientHeight;

		if (scrollHeight === 0 || clientHeight === 0) {
			return;
		}

		// const activeIndex = Math.floor(scrollTop / clientHeight);
		// activeNavigation.value = activeIndex;

		const scrollPercentage = Math.min(scrollTop / (scrollHeight - clientHeight), 1);
		const activeIndex = Math.floor(scrollPercentage * (leftNavigationItems.value.length - 1));
		activeNavigation.value = activeIndex;

		// console.log('scrollTop', scrollTop)
		// console.log('scrollHeight', scrollHeight)
		// console.log('clientHeight', clientHeight)



		// console.log('scrollPercentage', scrollPercentage)


		// console.log(activeNavigation.value, 'activeNavigation.value');
		
		}
	}

	watch(() => rightColumn.value, () => {
		handleScroll();
	});

	// onMounted(() => {
	// 	window.addEventListener('scroll', handleScroll);
	// })
	// onBeforeUnmount(() => {
	// 	window.removeEventListener('scroll', handleScroll)
	// })

	// 弹出层 滚动条
	
	function getOrgInfo() {
	    getUserOrg({}).then(response => {
	        var data = response.data;
			if(data!=null)
			{
				orgAccount.value=data.orgAccount;
				orgSign.value.form=data.orgSign;
				if(data.orgSign.status!=3)
				{
					orgSign.value.open = true;
				}
			}
	    });
	}
	
	function getSign(){
		getUserOrgSign({}).then(response => {
		    var data = response.data;
			if(data!=null)
			{
				orgSign.value.form=data;
				if(data.status==3)
				{
					orgSign.value.open = false;
				}
			}
		});
	}
	
	function getOrgInfoRefresh() {
		const loadingInstance = ElLoading.service({});
	    getUserOrgRefresh({}).then(response => {
	        var data = response.data;
			if(data!=null)
			{
				orgAccount.value=data.orgAccount;
				proxy.$modal.msgSuccess("资金数据已刷新");	
			}
			loadingInstance.close();
	    });
	}
	
	function cardInfo(){
		var accountNo=bankdata.value.form.cardNo;
		if(accountNo==null || accountNo=='')
		{
			ElMessage({
				message: '请先填写银行卡号',
				type: 'warning',
			})
			return
		}
		
			getCardInfo(accountNo).then(response => {
				 var data = response.data;
				bankdata.value.form.settleId=data.bankCode;
				 });
		
		
	}
	
	
function getRelationList(houseId)
	{
		relationList({ houseId: houseId }).then(response => {
		  relaList.value = response.data;
		  //total.value = Number(response.total);
		});
		
	}

function getPerOrderId() {
  loading.value = true;
  getPerId().then(response => {
    perOrderId.value = response.data;
    //total.value = Number(response.total);
    loading.value = false;
  });
}

function getPerHouseId() {
  loading.value = true;
  getPerId().then(response => {
    housedata.value.form.houseId = response.data;
    //total.value = Number(response.total);
    loading.value = false;
  });
}

function getOrgList() {
  loading.value = true;
  userListOrg().then(response => {
    orgList.value = response.data;
    //total.value = Number(response.total);
    loading.value = false;
  });
}

	


	// 上传文件
	function httpRequest(data, type) {
		var formData = new FormData();
		formData.append("file", data.file);
		formData.append("localType", 0);
		// 调用后端接口
		uploadByServer(formData).then(res => {
			var url = res.data.src;
			if (url) {
				if (type == 1) {
					form.value.personal.idcFront = url;
				} else if (type == 2) {
					persondata.value.form.idcFront=url;
				} else if (type == 3) {
					companydata.value.form.idcFront=url;
				} else if (type == 4) {
					bankdata.value.form.cardFront = url;
				} else if (type == 5) {
					housedata.value.form.houseCertificate= url;
				} else if (type == 6) {
					// imageUrl.value = url;
					form.value.companydata.idcFront = url;
				}
				else if (type == 7) {
					// imageUrl.value = url;
					form.value.companydata.idcFront = url;
				}
			}

		}).catch(err => {})
	}
	
	
	function httpRequestPlus(data, type,typeform) {
		var formData = new FormData();
		formData.append("file", data.file);
		formData.append("localType", 0);
		if (type == 1) {
				getIdCardOCRFace(formData,typeform);
			}
		else if (type == 2) {
				getIdCardOCRBack(formData,typeform);	
			} 
		else if (type == 3) {
				getBusinessLicense(formData,typeform);	
			} 	
		// 调用后端接口
	// 	uploadByServer(formData).then(res => {
	// 		var url = res.data.src;
	// 		if (url) {
	// 			if (type == 1) {
	// 				// imageUrl.value = url;
	// 				form.value.personaldata.idcFront = url;
	// 			} else if (type == 2) {
	// 				form.value.personaldata.idcBack = url;
	// 			} else if (type == 3) {
	// 				imageUrl2.value = url;
	// 			} else if (type == 4) {
	// 				bankdata.value.form.cardFront = url;
	// 			} else if (type == 5) {
	
	// 			}
	// 		}
	
	// 	}).catch(err => {})
	}
	
	function getBusinessLicense(formData,typeform) {
	  
	    BusinessLicense(formData).then(response => {
	        var data = response.data;
	        if (data && data.creditCode) {
				// 处理日期
				
				if(typeform==3)
				{
					companydata.value.form.companyName = data.companyName;
					companydata.value.form.creditCode = data.creditCode;
					companydata.value.form.license = data.url;
					companydata.value.form.detail=data.businessAddress;
					companydata.value.form.companyDate=data.validFromDate;
				}
				else if(typeform==2)
				{
					form.value.company.companyName = data.companyName;
					form.value.company.creditCode = data.creditCode;
					form.value.company.license = data.url;
					form.value.company.detail=data.businessAddress;
					form.value.company.companyDate=data.validFromDate;
					form.value.company.companyCapital = data.registeredCapital;
					form.value.company.companyBusiness = data.businessScope;
				}
	            // 处理日期
	            // var dateString = data.registrationDate;
	            // var formattedDate = dateString.replace(/年|月/g, "-").replace(/日/g, "");
	            // var timedate = new Date(formattedDate);
	            // var timestamp = timedate.getTime();
	            // var t = timestampToTime(timestamp);
	            // companydata.value.form.companyDate = happenTimeFun(t, 'yyyy-MM-dd');
	        }
	      
	    }).catch(() => {
	     
	    });
	}
	
	function getIdCardOCRFace(formData,typeform) {
	   
	    IdCardOCRFace(formData).then(response => {
	        var data = response.data;
	        if (data && data.idNumber) {
				if(typeform==1)
				{
					form.value.personal.name=data.name;
					form.value.personal.idc=data.idNumber;
					form.value.personal.idcAddress = data.address;
					if(data.sex=="男")
					{
						form.value.personal.sex=0;
					}
					else
					{
						form.value.personal.sex=1;
					}
					form.value.personal.brithDate = data.birthDate;
					form.value.personal.nation = data.ethnicity;
					form.value.personal.idcFront = data.url;
				}
				else if(typeform==2)
				{
					persondata.value.form.name=data.name;
					persondata.value.form.idc=data.idNumber;
					persondata.value.form.idcAddress = data.address;
					if(data.sex=="男")
					{
						persondata.value.form.sex=0;
					}
					else
					{
						persondata.value.form.sex=1;
					}
					persondata.value.form.brithDate = data.birthDate;
					persondata.value.form.nation = data.ethnicity;
					persondata.value.form.idcFront = data.url;
				}
				else if(typeform==3)
				{
					companydata.value.form.legalName=data.name;
					companydata.value.form.idc=data.idNumber;
					companydata.value.form.idcAddress = data.address;
					// if(data.sex=="男")
					// {
					// 	companydate.value.form.sex=0;
					// }
					// else
					// {
					// 	companydate.value.form.sex=1;
					// }
					companydata.value.form.brithDate = data.birthDate;
					// companydate.value.form.nation = data.ethnicity;
					companydata.value.form.idcFront = data.url;
				}
				else if(typeform==4)
				{
					form.value.company.legalName=data.name;
					form.value.company.idc=data.idNumber;
					form.value.company.idcAddress = data.address;
					form.value.company.brithDate = data.birthDate;
					form.value.company.idcFront = data.url;
				}
	        }
	       
	    }).catch(() => {
	       
	    });
	}


function getIdCardOCRBack(formData,typeform) {
   
    IdCardOCRBack(formData).then(response => {
        var data = response.data;
        if (data && data.url) {
			if(typeform==1)
			{
				form.value.personal.idcBack = data.url;
				let arr=data.validPeriod.split('-');
				
				form.value.personal.idcDate =arr[0].replace(/\./g,'-');
				if(arr[1]==="长期")
				{
					form.value.personal.idcExpiry ='';
				}
				else{
					form.value.personal.idcExpiry =arr[1].replace(/\./g,'-');
				}
			}
			else if(typeform==2)
			{
				persondata.value.form.idcBack = data.url;
				let arr=data.validPeriod.split('-');
				
				persondata.value.form.idcDate =arr[0].replace(/\./g,'-');
				if(arr[1]==="长期")
				{
					persondata.value.form.idcExpiry ='';
				}
				else{
					persondata.value.form.idcExpiry =arr[1].replace(/\./g,'-');
				}
			}
			else if(typeform==3)
			{
				companydata.value.form.idcBack = data.url;
				let arr=data.validPeriod.split('-');
				
				companydata.value.form.idcDate =arr[0].replace(/\./g,'-');
				if(arr[1]==="长期")
				{
					companydata.value.form.idcExpiry ='';
				}
				else{
					companydata.value.form.idcExpiry =arr[1].replace(/\./g,'-');
				}
			}
			else if(typeform==4)
			{
				form.value.company.idcBack = data.url;
				let arr=data.validPeriod.split('-');
				
				form.value.company.idcDate =arr[0].replace(/\./g,'-');
				if(arr[1]==="长期")
				{
					form.value.company.idcExpiry ='';
				}
				else{
					form.value.company.idcExpiry =arr[1].replace(/\./g,'-');
				}
			}
            
        }
      
    }).catch(() => {
      
    });
}


	function radioChange(e, type) {
		if (type == 1) {
			// 收款卡类型
		} else if (type == 2) {
			// 收款卡所属方
			if (bankdata.value.form.isBorrowText == '借款人') {
				bankdata.value.form.isBorrow = 1
			} else {
				bankdata.value.form.isBorrow = 0
			}

			bankdata.value.form.cardtype = '个人'
		} else if (type == 3) {
			// 签署方式
			if (form.value.orderFromDTO.contractTypeText == '在线') {
				form.value.orderFromDTO.contractType = 1
			} else {
				form.value.orderFromDTO.contractType = 2
			}
		} else if (type == 4) {
			// 借款人类型
			if (form.value.orderFromDTO.borrowerTypeText == '个人') {
				form.value.orderFromDTO.borrowerType = 1
			} else {
				form.value.orderFromDTO.borrowerType = 2
			}
		} else if (type == 5) {
			// 性别
			if (form.value.personal.sexText == '男') {
				form.value.personal.sex = 0
			} else {
				form.value.personal.sex = 1
			}
		}
	}


	function cityChange(e, type) {
		if (type == 1) {
			form.value.personal.province = form.value.personal.citycode[0];
			form.value.personal.city = form.value.personal.citycode[1];
			form.value.personal.district = form.value.personal.citycode[2];
		}
		else if (type == 2) {
			form.value.company.province = form.value.company.citycode[0];
			form.value.company.city = form.value.company.citycode[1];
			form.value.company.district = form.value.company.citycode[2];
		}
		else if (type == 3) {
			persondata.value.form.province = persondata.value.form.citycode[0];
			persondata.value.form.city = persondata.value.form.citycode[1];
			persondata.value.form.district = persondata.value.form.citycode[2];
		}
		else if (type == 4) {
			companydata.value.form.province = companydata.value.form.citycode[0];
			companydata.value.form.city = companydata.value.form.citycode[1];
			companydata.value.form.district = companydata.value.form.citycode[2];
		}
		else if (type == 5) {
			housedata.value.form.province = housedata.value.form.citycode[0];
			housedata.value.form.city = housedata.value.form.citycode[1];
			housedata.value.form.district = housedata.value.form.citycode[2];
		}
		else if (type == 6) {
			form.value.borrowInfoFromDTO.signProvince = form.value.borrowInfoFromDTO.citycode[0];
			form.value.borrowInfoFromDTO.signCity = form.value.borrowInfoFromDTO.citycode[1];
			form.value.borrowInfoFromDTO.signDistrict = form.value.borrowInfoFromDTO.citycode[2];
			
			// form.value.borrowInfoFromDTO.signProvince = e[0];
			// form.value.borrowInfoFromDTO.signCity = e[1];
			// form.value.borrowInfoFromDTO.signDistrict = e[1];
		}

	}

	/** 查询订单列表 */
	function getList() {
		loading.value = true;
		orderList(queryParams.value).then(response => {
			var data = response.data
			orderArray.value = data.list;
			total.value = Number(data.total);
			loading.value = false;
		});
	}
	
	// function getProList()
	// {
	// 	getProductList(1).then(response => {
	// 		productList.value = response.data
	// 	});
		
		
	// }
	
	function handleOrgChange(value)
	{
		getProductConfigList({ OrgTenantId: orgAccount.value.tenantId,XdTenantId: value }).then(response => {
		  productList.value = response.data;
		  //total.value = Number(response.total);
		});
	}

		/** 查询地区列表 */
	function getRegionList() {
		regionList({ threeLevel: 3 }).then(response => {
			var data = response.data;
			cityOpt.value = data;
		});
	}

/** 查询银行列表 */
	function getBankList() {
		BankList().then(response => {
			var data = response.data;
			bankdata.value.banklist = data;
		});
	}

	// 获取还款计划列表
	function getRepaymentList() {

		// repaymentdata.value.open = true;

		if (!form.value.borrowInfoFromDTO.borrowAmount) {
			ElMessage({
				message: '借款金额不能为空',
				type: 'warning',
			})
			return
		}
		if (!form.value.borrowInfoFromDTO.beginDate) {
			ElMessage({
				message: '借款起始日期不能为空',
				type: 'warning',
			})
			return
		}
		if (!form.value.borrowInfoFromDTO.endDate) {
			ElMessage({
				message: '借款结束日期',
				type: 'warning',
			})
			return
		}
		if (!form.value.borrowInfoFromDTO.borrowRate) {
			ElMessage({
				message: '借款年利率不能为空',
				type: 'warning',
			})
			return
		}
		if (!form.value.borrowInfoFromDTO.repaymentType) {
			ElMessage({
				message: '还款方式不能为空',
				type: 'warning',
			})
			return
		}
		if(form.value.borrowInfoFromDTO.repaymentType>4)
		{
			ElMessage({
				message: '该还款方式不生成还款计划',
				type: 'warning',
			})
			return
		}
		var data = {
			"amount": form.value.borrowInfoFromDTO.borrowAmount,
			"beginDate": form.value.borrowInfoFromDTO.beginDate,
			"endDate": form.value.borrowInfoFromDTO.endDate,
			"rates": form.value.borrowInfoFromDTO.borrowRate,
			"repaymentType": form.value.borrowInfoFromDTO.repaymentType
		}
		
		RepaymentList(data).then(response => {
			var data = response.data;
			if (data && data.length) {
				repaymentdata.value.open = true;
				repaymentdata.value.list = data;
				repaymentdata.value.showdata = data[data.length - 1];
			}
		});
	}

	// 取消按钮
	function cancel(type) {

		if (type == 'bank') {
			bankdata.value.open = false;
		} else if (type == 'borrowdata') {
			borrowdata.value.open = false;
		} else if (type == 'housedata') {
			housedata.value.open = false;
		} else if (type == 'withdrawdata') {
			withdrawdata.value.open = false;
		} else if (type == 'pwddata') {
			pwddata.value.open = false;
		} else if (type == 'editbank') {
			editbank.value.open = false;
		} else if (type == 'editphone') {
			editphone.value.open = false;
		} else if (type == 'editpaypwd') {
			editpaypwd.value.open = false;
		} else if (type == 'orderhandle') {
			orderhandle.value.open = false;
		}
		else if (type == 'transferdata') {
			transferdata.value.open = false;
		}
		else {
			open.value = false;
		}

		reset(type);
	}

	// 表单重置
	function reset(type) {
		if (type == 'bank') {
			bankdata.value.form = JSON.parse(JSON.stringify(bankdata.value.resetForm));
			proxy.resetForm("bankRef");

		} 
		else if (type == 'transferdata') {
			transferdata.value.form = JSON.parse(JSON.stringify(transferdata.value.resetForm));
			proxy.resetForm("transferRef");
		
		} 
		else if (type == 'housedata') {
			housedata.value.form = JSON.parse(JSON.stringify(housedata.value.resetForm));
			proxy.resetForm("houseRef");

		} 
		else if (type == 'borrowdata' || type == 'suretydata' || type == 'equitydata') {
			persondata.value.form = JSON.parse(JSON.stringify(persondata.value.resetForm));
			companydata.value.form = JSON.parse(JSON.stringify(companydata.value.resetForm));
			borrowdata.value.form.cardtype='个人';
			borrowdata.value.form.idcType=1
			borrowdata.value.form.role = null;
			proxy.resetForm("personRef");
			proxy.resetForm("companyRef");
		} 
		else {
			form.value = JSON.parse(JSON.stringify(resetForm.value));
			proxy.resetForm("rightColumn");
			productList.value=[];
		}
	}





	function bCityChange(e) {
		form.value.borrowInfoFromDTO.signProvince = e[0];
		form.value.borrowInfoFromDTO.signCity = e[1];
		form.value.borrowInfoFromDTO.signDistrict = e[1];
	}


	function advanceRateChange() {
		var beginDate = form.value.borrowInfoFromDTO.beginDate;
		var borrowDays = form.value.borrowInfoFromDTO.borrowDays;

		// console.log('borrowDays', borrowDays);

		if (beginDate && borrowDays) {
			borrowDays = borrowDays * 1 || 1;
			borrowDays = borrowDays - 1;
			// 获取当前日期
			var currentDate = new Date(beginDate);
			// 将当前日期增加20天
			currentDate.setDate(currentDate.getDate() + borrowDays);
			// 获取增加20天后的日期
			var futureDate = currentDate.toISOString().split('T')[0];
			form.value.borrowInfoFromDTO.endDate = futureDate;
		}
	}


	/** 搜索按钮操作 */
	function handleQuery() {
		queryParams.value.pageNum = 1;
		getList();
	}

	/** 重置按钮操作 */
	function resetQuery() {
		proxy.resetForm("queryRef");
		handleQuery();
	}

	// 多选框选中数据
	function handleSelectionChange(selection) {
		ids.value = selection.map(item => item.userId);
		single.value = selection.length != 1;
		multiple.value = !selection.length;
	}
	/** 更新订单状态 */
	function handleStatus(row, status)
	{
		const _orderId = row.orderId;
		updateStatus({
        orderId: _orderId,
        status: status,
		}).then(response => {
			proxy.$modal.msgSuccess("处理成功");
			getList();
		});
	}
	

	/** 新增按钮操作 */
	function handleAdd(type) {
		reset(type);
		if (type == 'bank') {
			if (!form.value.borrowInfoFromDTO.borrowAmount) {
				ElMessage({
					message: '借款金额不能为空',
					type: 'warning',
				})
				return
			}
			bankdata.value.open = true;
		} else if (type == 'borrowdata') {
			borrowdata.value.title = '共借人';
			borrowdata.value.open = true;
			borrowdata.value.form.role=1;
		} else if (type == 'suretydata') {
			borrowdata.value.title = '担保人';
			borrowdata.value.form.role=2;
			borrowdata.value.open = true;
		} else if (type == 'equitydata') {
			borrowdata.value.title = '产权人';
			borrowdata.value.open = true;
			borrowdata.value.form.role=3;
			
		} else if (type == 'housedata') {
			housedata.value.open = true;
			getPerHouseId();
		} else if (type == 'withdrawdata') {
			withdrawdata.value.open = true;
		} else if (type == 'withdrawdatalist') {
			withdrawdata.value.listopen = true;
		} else if (type == 'pwddata') {
			pwddata.value.open = true;
		} else if (type == 'editbank') {
			editbank.value.open = true;
		} else if (type == 'editphone') {
			editphone.value.open = true;
		} else if (type == 'editpaypwd') {
			editpaypwd.value.open = true;
		} 
		 else {
			 if(orgSign.value.form.status!=3)
			 {
			 	orgSign.value.open = true;
			 }
			 else
			 {
				 getPerOrderId();
				 open.value = true;
				 title.value = "新增放款信息";
			 }
			
			// setTimeout(() => {
			// 	rightColumn.value = document.querySelector('.right-column');
			// 	if (rightColumn.value) {
			// 		rightColumn.value.addEventListener('scroll', handleScroll);
			// 	}
			// }, 1000)
		}

	}
	
	function handleBack(row)
	{
		orderhandle.value.open = true;
		orderhandle.value.form.remark='';
		orderhandle.value.form.orderId=row.orderId;
		orderhandle.value.form.status=2;
	}
	
	function handleTransfer(row)
	{
		transferdata.value.open = true;
		transferdata.value.form.cardId=row.cardId;
	}

	// 删除
	function handDel(row, type) {

		// if (!item) {
		// 	return
		// }
		var index = -1;
		if (type == 'bank') {
			const _cardId = row.cardId;
			delCard(_cardId).then(response => {
				for (let i = 0; i < form.value.cardFromDTOList.length; i++) {
					var vdata = form.value.cardFromDTOList[i];
				
					if (vdata.cardId == row.cardId) {
						index = i;
					}
				}
				if (index >= 0) {
					form.value.cardFromDTOList.splice(index, 1);
				}
			});
			
			
		} else if(type=='borrowdata' || type == 'suretydata'){
			const _houseId = row.houseId;
			
			const _id = row.id;
			const _type = row.type;
			if(_type==1)
			{
				delPerson(_id).then(response => {
						if(type=='borrowdata')
						{
							for (let i = 0; i < form.value.orderGJList.length; i++) {
								var vdata = form.value.orderGJList[i];
							
								if (vdata.id == _id) {
									index = i;
								}
							}
							if (index >= 0) {
								form.value.orderGJList.splice(index, 1);
							}
						}
						else if(type == 'suretydata')
						{
							for (let i = 0; i < form.value.orderDBList.length; i++) {
								var vdata = form.value.orderDBList[i];
							
								if (vdata.id == _id) {
									index = i;
								}
							}
							if (index >= 0) {
								form.value.orderDBList.splice(index, 1);
							}
						}
					});
			}
			else if(_type==2)
			{
				delCompany(_id).then(response => {
					if(type=='borrowdata')
					{
						for (let i = 0; i < form.value.orderGJList.length; i++) {
							var vdata = form.value.orderGJList[i];
						
							if (vdata.id == _id) {
								index = i;
							}
						}
						if (index >= 0) {
							form.value.orderGJList.splice(index, 1);
						}
					}
					else if(type == 'suretydata')
					{
						for (let i = 0; i < form.value.orderDBList.length; i++) {
							var vdata = form.value.orderDBList[i];
						
							if (vdata.id == _id) {
								index = i;
							}
						}
						if (index >= 0) {
							form.value.orderDBList.splice(index, 1);
						}
					}
					});
			}
			
			
		}
		else if(type=='housedata'){
			const _houseId = row.houseId;
			delHouse(_houseId).then(response => {
				for (let i = 0; i < form.value.houseList.length; i++) {
					var vdata = form.value.houseList[i];
				
					if (vdata.houseId == row.houseId) {
						index = i;
					}
				}
				if (index >= 0) {
					form.value.houseList.splice(index, 1);
				}
			});
		}
	}


	/** 修改按钮操作 */
	function handleUpdate(row,type) {
		reset(type);
		if(type=='order')
		{
			// reset();
			perOrderId.value= row.orderId;
			const _orderId = row.orderId;
			orderDetail(_orderId).then(response => {
				form.value = response.data;
				if(form.value.orderFromDTO.borrowerType==1)
				{
					form.value.orderFromDTO.borrowerTypeText="个人";
					form.value.personal.citycode = [form.value.personal.province, form.value.personal.city, form.value.personal.district];
				}
				else if (form.value.orderFromDTO.borrowerTyp == 2) {
					form.value.orderFromDTO.borrowerTypeText="企业";
					form.value.company.citycode = [form.value.company.province, form.value.company.city, form.value.company.district];
				}
				if(form.value.orderFromDTO.contractType==1)
				{
					form.value.orderFromDTO.contractTypeText="在线";
				}
				else{
					form.value.orderFromDTO.contractTypeText="线下";
				}
			
				form.value.borrowInfoFromDTO.citycode = [form.value.borrowInfoFromDTO.signProvince, form.value.borrowInfoFromDTO.signCity, form.value.borrowInfoFromDTO.signDistrict];
				form.value.cardFromDTOList=response.data.cardList;
				form.value.orderGJList=response.data.orderGJList;
				form.value.orderDBList=response.data.orderDBList;
				form.value.houseList=response.data.houseList;
				open.value = true;
				title.value = "修改放款信息";
				handleOrgChange(form.value.orderFromDTO.orgId);
			});
		}
		else if(type=='borrowdata' || type == 'suretydata' || type == 'equitydata')
		{
			const _id = row.id;
			const _type = row.type;
			if(_type==1)
			{
				
				OrderPersonInfo(_id).then(response => {
					persondata.value.form = response.data;
					persondata.value.form.citycode = [response.data.province, response.data.city, response.data.district];
					borrowdata.value.form.cardtype='个人';
					borrowdata.value.form.idcType=persondata.value.form.idcType;
					});
			}
			else if(_type==2)
			{
				OrderCompanyInfo(_id).then(response => {
					companydata.value.form = response.data;
					companydata.value.form.citycode = [response.data.province, response.data.city, response.data.district];
					borrowdata.value.form.cardtype='对公';
					borrowdata.value.form.idcType=companydata.value.form.idcType;
					});
			}
			
			if (type == 'borrowdata') {
				borrowdata.value.title = '共借人';
				borrowdata.value.open = true;
				borrowdata.value.form.role=1;
			} else if (type == 'suretydata') {
				borrowdata.value.title = '担保人';
				borrowdata.value.form.role=2;
				borrowdata.value.open = true;
			} else if (type == 'equitydata') {
				borrowdata.value.title = '产权人';
				borrowdata.value.open = true;
				borrowdata.value.form.role=3;
				
			}
			
			
		}
		else if (type == 'housedata') {
			const _houseId = row.houseId;
			getRelationList(_houseId);
			OrderHouseInfo(_houseId).then(response => {
				housedata.value.form = response.data;
				housedata.value.form.citycode = [response.data.province, response.data.city, response.data.district];
				
				});
			housedata.value.open = true;
			console.log(housedata.value.form.relationIds);
			
		}
		else if (type == 'bank') {
			const _cardId = row.cardId;
			OrderCardInfo(_cardId).then(response => {
				bankdata.value.form = response.data;
				// housedata.value.form.citycode = [response.data.province, response.data.city, response.data.district];
				
				});
			bankdata.value.open = true;
			
		}
	}

	/** 提交按钮 */
	function submitForm(type) {

		if (type == 'transferdata') {
		
			proxy.$refs["transferRef"].validate(valid => {
				if (valid) {
							
					addTransfer(transferdata.value.form).then(response => {
						form.value.transferList=response.data;
						proxy.$modal.msgSuccess("提交成功");		 
						transferdata.value.open = false;
					});
				}
			});
		}
		else if (type == 'orgSign') {
			getSign();
		}else if (type == 'bank') {
		
			proxy.$refs["bankRef"].validate(valid => {
				if (valid) {
					bankdata.value.form.orderId=perOrderId;					
					saveCard(bankdata.value.form).then(response => {
						form.value.cardFromDTOList=response.data;
					  // proxy.$modal.msgSuccess("修改成功");		 
						bankdata.value.open = false;
					});
				}
			});
		} else if (type == 'borrowdata') {

			// 可以用标题 判断 是共借人/担保人/产权人

			if(borrowdata.value.form.cardtype == '个人'){
				proxy.$refs["personRef"].validate(valid => {
					if (valid) {
						persondata.value.form.orderId=perOrderId;
						persondata.value.form.idcType=borrowdata.value.form.idcType;
						
						persondata.value.form.role=borrowdata.value.form.role;
						if(borrowdata.value.form.role==3)
						{
							persondata.value.form.houseId=housedata.value.form.houseId;
						}
						savePerson(persondata.value.form).then(response => {
							if(borrowdata.value.form.role==1)
							{
								
								form.value.orderGJList=response.data;
							}
							else if(borrowdata.value.form.role==2)
							{
								form.value.orderDBList=response.data;
							}
							else if(borrowdata.value.form.role==3)
							{
								 getRelationList(housedata.value.form.houseId);
							}
							
						  //proxy.$modal.msgSuccess("修改成功");
						
							borrowdata.value.open = false;
						});
					}
				});
			}
			else{
				proxy.$refs["companyRef"].validate(valid => {
					if (valid) {
						companydata.value.form.orderId=perOrderId;
						companydata.value.form.idcType=borrowdata.value.form.idcType;
						companydata.value.form.companyTel=companydata.value.form.phone;
						companydata.value.form.role=borrowdata.value.form.role;
						if(borrowdata.value.form.role==3)
						{
							companydata.value.form.houseId=housedata.value.form.houseId;
						}
						
						saveCompany(companydata.value.form).then(response => {
							if(borrowdata.value.form.role==1)
							{
								
								form.value.orderGJList=response.data;
							}
							else if(borrowdata.value.form.role==2)
							{
								form.value.orderDBList=response.data;
							}
							else if(borrowdata.value.form.role==3)
							{
								 getRelationList(housedata.value.form.houseId);
							}
							
						 // proxy.$modal.msgSuccess("修改成功");
							borrowdata.value.open = false;
						});
					}
				});
				
			}
			
			
		
		} else if (type == 'housedata') {
		
			
			proxy.$refs["houseRef"].validate(valid => {
				if (valid) {
					housedata.value.form.orderId=perOrderId;
					saveHouse(housedata.value.form).then(response => {
						form.value.houseList=response.data;
						proxy.$modal.msgSuccess("修改成功");
						housedata.value.open = false;
					});
				}
			});
			
		}  else if (type == 'orderhandle') {
			
			proxy.$refs["orderhandleRef"].validate(valid => {
				if (valid) {
				
					updateStatus(orderhandle.value.form).then(response => {
						proxy.$modal.msgSuccess("处理成功");
						getList();
						orderhandle.value.open = false;
					});
				}
			});
			
		}
		 else if (type == 'withdrawdata') {
			withdrawdata.value.open = false;
		} else if (type == 'pwddata') {
			pwddata.value.open = false;
		} else if (type == 'editbank') {
			editbank.value.open = false;
		} else if (type == 'editphone') {
			editphone.value.open = false;
		} else if (type == 'editpaypwd') {
			editpaypwd.value.open = false;
		} else {
			
			proxy.$refs["rightColumn"].validate(valid => {
				if (valid) {
					if(form.value.cardFromDTOList.length<1){
						ElMessage({
							message: '请先填写收款卡信息',
							type: 'warning',
						})
						return
					}
					form.value.orderFromDTO.id=perOrderId;
					if(form.value.orderFromDTO.borrowerType == 1)
					{
						saveOrderPersonal(form.value).then(response => {
							proxy.$modal.msgSuccess("修改成功");
							open.value = false;
							getList();
						});
					}
					else
					{
						saveOrderCompany(form.value).then(response => {
							proxy.$modal.msgSuccess("修改成功");
							open.value = false;
							getList();
						});
					}
				}
			});
		}




	}

	/** 导出按钮操作 */
	function handleExport() {
		proxy.download('system/company/export', {
			...queryParams.value
		}, `company_${new Date().getTime()}.xlsx`)
	}
	
	getBankList();
	getRegionList();
	getList();
	getOrgList();
	getOrgInfo();
	getAccountInfo();
</script>

<style scoped>
	.app-container {
		background: #ffffff !important;
	}
</style>

<style lang="scss">
	.srf-card {
		width: 100%;
		background: #FFFFFF;
		border: 1px solid #F5F5F5;
		box-shadow: 0px 4px 6px 0px rgba(10, 2, 4, 0.03);

		.srf-top {
			width: 100%;
			height: 38px;
			line-height: 38px;
			background: #FEF3EB;
			padding: 0 24px;
			display: flex;
			align-items: center;
			color: #333333;
			font-size: 16px;
			font-weight: 550;

			.icon {
				width: 14px;
				height: 14px;
				display: block;
				margin-right: 16px;
			}
		}

		.srf-cont {
			width: 100%;
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 20px 56px;
			box-sizing: border-box;

			.srf-item {

				.t {
					color: #666666;
					font-size: 14px;
					line-height: 1;
				}

				.d {
					color: #989898;
					font-size: 12px;
					line-height: 1;
					margin-top: 10px;
				}

				.price {
					color: #666666;
					font-size: 12px;
				}

				.tx {
					line-height: 1;
					color: #FF6201;
					font-size: 12px;
					padding-right: 12px;
					position: relative;
					margin-right: 12px;

					&::after {
						content: '';
						width: 1px;
						height: 12px;
						background: #F5F5F5;
						position: absolute;
						right: 0;
						top: 50%;
						transform: translateY(-50%);
						z-index: 2;
					}
				}

				.sz {
					line-height: 1;
					color: #666666;
					font-size: 12px;

					.el-dropdown-link {
						color: #666666 !important;
						font-size: 12px;
					}
				}

				.status {
					.t {
						position: relative;
						color: #1FBD2E;
						font-size: 12px;
						padding-left: 12px;

						&::after {
							content: '';
							width: 5px;
							height: 5px;
							background: #2FBC3D;
							border-radius: 50%;
							position: absolute;
							left: 0;
							top: 50%;
							transform: translateY(-50%);
							z-index: 2;
						}
					}
				}
			}

		}

	}




	.four-box {
		width: 100%;
		display: flex;
		flex-wrap: wrap;

		.four-item {
			width: calc((100% - 30px) / 4);
			height: 112px;
			background: #FFF5EF;
			border-radius: 16px;
			margin-right: 10px;
			display: flex;
			align-items: center;
			justify-content: center;

			&:nth-child(4n) {
				margin-right: 0;
			}

			.four-img {
				width: 68px;
				height: 68px;
				display: block;
				flex-shrink: 0;
				margin-right: 14px;
			}

			.four-cont {
				line-height: 1;

				.four-tt {
					color: #333333;
					font-size: 12px;

					.big1 {
						font-weight: 550;
						color: #FF7C2F;
						font-size: 28px;
						padding-right: 2px;
					}

					.big2 {
						color: #FF7C2F;
						font-size: 14px;
						padding-right: 2px;
					}
				}

				.four-dd {
					color: #666666;
					font-size: 12px;
					margin-top: 6px;
				}
			}
		}
	}

	.search-form {
		margin-top: 20px;

		.search-vitem {
			width: 230px !important;
		}

		.showline {
			width: 100%;
			height: 8px;
			background: #f4f7fc;
			margin-bottom: 25px;
			margin-top: 10px;
		}



		.checkbox-list {
			width: 100%;
			display: flex;
			align-items: center;
			margin-bottom: 15px;

			.checkbox-item {
				width: 50%;
				font-size: 14px;
				display: flex;
				align-items: center;
			}
		}

		.showtext {
			width: 100%;
			font-size: 14px;
			margin-bottom: 15px;

			span {
				font-weight: 550;
				color: #FF6201;
			}
		}
	}


	.el-dialog__headerbtn {
		top: 0;

	}

	.el-dialog__header {
		height: 50px;
		line-height: 50px;
		padding: 0 0;
		word-break: break-all;
		text-align: center;
		box-shadow: 0 3px 6px 1px rgba(0, 0, 0, .05);
		width: 100%;
		overflow: auto;
	}

	.el-dialog__body {
		width: 100%;
		background: #FFFFFF;
		padding: 0;
	}

	.dialog-page {
		width: 100%;
		display: flex;
		height: 600px;


		.dialog-navlist {
			overflow-y: auto;
			width: 170px;
			height: 100%;
			padding: 15px 20px;

			.nav-lsit {
				width: 100%;
				height: 100%;
				overflow-y: auto;

				.nav-item {
					width: 100%;
					height: 50px;
					width: 100%;
					line-height: 50px;
					color: #50565d;
					background-color: #f5f9ff;
					margin-bottom: 12px;
					text-align: center;
					border-radius: 4px;

					&.on {
						background: #FF6201;
						color: #FFFFFF;
					}

				}
			}

		}

	}





	.dialog-custom {
		flex: 1;
		background: #f5f9ff !important;
		padding: 20px;
		height: 100%;
		// width: 100%;

		.dialog-main {
			width: 100%;
			height: 100%;
			overflow-y: auto;

			.dialog-item {
				width: 100%;
				border-radius: 10px;
				background: #FFFFFF;
				overflow: hidden;


				&:not(:first-child) {
					margin-top: 20px;
				}

				.dialog-tbox {
					width: 100%;
					height: 48px;
					padding: 0 40px;
					font-size: 16px;
					font-weight: 550;
					border-bottom: 1px solid #e4efff;
					display: flex;
					align-items: center;
					position: relative;

					&::after {
						content: '';
						position: absolute;
						left: 20px;
						top: 50%;
						transform: translateY(-50%);
						width: 3px;
						height: 14px;
						background: #FF6201;
					}

					.tips {
						font-size: 12px;
						padding-left: 14px;
						color: red;
						font-weight: normal;
					}
				}

				.dialog-cont {
					width: 100%;
					padding: 30px;
					box-sizing: border-box;
				}

				.c-tips {
					background-color: #fffbe6;
					padding: 8px 15px 8px 15px;
					display: flex;
					align-items: flex-start;
					margin-bottom: 20px;
					line-height: 1.5;

					.icon {
						color: #faad14;
						margin-top: 4px;
					}

					.c-t {
						color: #f7ba1e;
						font-size: 14px;
						margin-left: 10px;
					}
				}

				.w-tip {
					padding: 0 20px;
					color: #faad14;
					font-size: 12px;
				}

				.search-fitem {
					width: 100%;

					&.v70 {
						width: 63.5%;
					}

					&.v50 {
						width: 45%;
					}
				}

				.showbtn {
					width: 100%;
					margin-top: 20px;
				}

				.showtips {
					padding-left: 140px;
					font-size: 14px;
					color: red;
				}

				.file-box {
					width: 100%;
					margin-top: 20px;

					.file-title {
						padding-left: 16px;
						position: relative;
						font-size: 16px;
						font-weight: 550;
						line-height: 1;

						&:after {
							content: '';
							width: 3px;
							height: 100%;
							position: absolute;
							top: 50%;
							transform: translateY(-50%);
							left: 0;
							background: #FF6201;
						}
					}

					.file-cont {
						margin-top: 20px;
					}
				}

				.step {
					display: flex;
					width: 100%;
					background: #f6faff;
					margin-bottom: 60px;

					.step-item {
						position: relative;
						padding: 15px 30px;
						background: #f6faff;

						.content {
							color: #50565d;
							width: 250px;

							div {
								margin-block: 5px;
							}
						}

						.bottom {
							position: absolute;
							bottom: -35px;
							width: 100%;

							.text {
								position: absolute;
								top: 25px;
								left: -13px;
								width: 50px;
								text-align: center;
							}

							.round {
								width: 24px;
								height: 24px;
								background-color: #FF6201;
								border-radius: 50%;
							}

							.line {
								display: inline-block;
								width: 100%;
								height: 4px;
								background-color: #FF6201;
								position: absolute;
								top: 50%;
								transform: translateY(-50%);
								margin-right: 15px;
							}
						}
					}
				}

			}
		}


		.el-form-item {
			width: 45%;

			&.vvv0 {
				width: 20%;
			}

			&.vvv1 {
				width: 29%;
			}


			&.vvv2 {
				width: 35%;
			}

			&.v100 {
				width: 95%;
			}

			.search-vitem {
				width: 220px !important;

				&.v40 {
					width: 40% !important;
				}

				&.v60 {
					width: 60% !important;
				}

				&.v100 {
					width: 100% !important;
				}

				&.flex_1 {
					width: auto !important;
					flex: 1 !important;
				}
			}
		}


		.show-tt {
			position: relative;
			color: #50565d;
			font-size: 14px;
			display: block;
			margin-bottom: 25px;
			margin-left: -10px;
			padding-left: 15px;
			font-weight: 700;

			&::after {
				content: "";
				position: absolute;
				top: 50%;
				left: 0;
				width: 8px;
				height: 8px;
				border-radius: 50%;
				-webkit-transform: translateY(-50%);
				transform: translateY(-50%);
				background-color: #ee4e41;
			}
		}

	}



	.dialog-box1 {
		width: 100%;
		background-color: rgb(246, 250, 255);
		margin-bottom: 10px;
		padding: 10px 10px 10px 0;
		margin-top: 10px;
	}

	.flex-end {
		display: flex;
		align-items: center;
		justify-content: flex-end;
		color: red;
		font-size: 14px;
	}
</style>


<style scoped>
	.avatar-uploader .avatar {
		width: 178px;
		height: 178px;
		display: flex;
		align-items: cen;
	}
</style>

<style>
	.avatar-uploader .el-upload {
		border: 1px dashed #8c939d;
		border-radius: 6px;
		cursor: pointer;
		position: relative;
		overflow: hidden;
		transition: all 0.4s;
	}

	.avatar-uploader .el-upload:hover {
		border-color: #FF6201;
	}

	.el-icon.avatar-uploader-icon {
		font-size: 28px;
		color: #8c939d;
		width: 178px;
		height: 178px;
		text-align: center;
	}
</style>